double RegulaFalsi(f, left, right) double (*f)(), left, right;
{
  double d = (*f)(right) - (*f)(left);
  if (d != 0.0)
    return (right - (*f)(right) * (right - left) / d);
  return ((left + right) / 2.0);
}


x86 assembly (clang, -O0):
<RegulaFalsi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
call   *%rcx
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rcx
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   *%rcx
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1163 <RegulaFalsi+0x63>
jp     1163 <RegulaFalsi+0x63>
jmp    11a3 <RegulaFalsi+0xa3>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rcx
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
call   *%rcx
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  -0x28(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11be <RegulaFalsi+0xbe>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xe4b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RegulaFalsi>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm0,0x10(%rsp)
mov    %rdi,%rbx
movsd  %xmm1,0x8(%rsp)
movaps %xmm1,%xmm0
mov    $0x1,%al
call   *%rdi
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   *%rbx
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
movsd  %xmm1,0x18(%rsp)
ucomisd %xmm0,%xmm1
jne    1147 <RegulaFalsi+0x47>
jnp    1175 <RegulaFalsi+0x75>
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   *%rbx
movsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm1
subsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm2,%xmm0
divsd  0x18(%rsp),%xmm1
subsd  %xmm1,%xmm0
jmp    1189 <RegulaFalsi+0x89>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0xe77(%rip),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @RegulaFalsi(double (...)* %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double (...)*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double (...)* %0, double (...)** %5
store double %1, double* %6
store double %2, double* %7
%9 = load double (...)*, double (...)** %5
%10 = load double, double* %7
%11 = bitcast double (...)* %9 to double (double, ...)*
%12 = call double (double, ...) %11(double %10)
%13 = load double (...)*, double (...)** %5
%14 = load double, double* %6
%15 = bitcast double (...)* %13 to double (double, ...)*
%16 = call double (double, ...) %15(double %14)
%17 = fsub double %12, %16
store double %17, double* %8
%18 = load double, double* %8
%19 = fcmp une double %18, 0.000000e+00
br i1 %19, label %20, label %33
20: ; preds = %3
%21 = load double, double* %7
%22 = load double (...)*, double (...)** %5
%23 = load double, double* %7
%24 = bitcast double (...)* %22 to double (double, ...)*
%25 = call double (double, ...) %24(double %23)
%26 = load double, double* %7
%27 = load double, double* %6
%28 = fsub double %26, %27
%29 = fmul double %25, %28
%30 = load double, double* %8
%31 = fdiv double %29, %30
%32 = fsub double %21, %31
store double %32, double* %4
br label %38
33: ; preds = %3
%34 = load double, double* %6
%35 = load double, double* %7
%36 = fadd double %34, %35
%37 = fdiv double %36, 2.000000e+00
store double %37, double* %4
br label %38
38: ; preds = %33, %20
%39 = load double, double* %4
ret double %39
}

LLVM IR (-O2):
define double @RegulaFalsi(double (...)* nocapture %0, double %1, double %2) {
%4 = bitcast double (...)* %0 to double (double, ...)*
%5 = tail call double (double, ...) %4(double %2)
%6 = tail call double (double, ...) %4(double %1)
%7 = fsub double %5, %6
%8 = fcmp une double %7, 0.000000e+00
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = tail call double (double, ...) %4(double %2)
%11 = fsub double %2, %1
%12 = fmul double %11, %10
%13 = fdiv double %12, %7
%14 = fsub double %2, %13
br label %18
15: ; preds = %3
%16 = fadd double %1, %2
%17 = fmul double %16, 5.000000e-01
br label %18
18: ; preds = %15, %9
%19 = phi double [ %14, %9 ], [ %17, %15 ]
ret double %19
}