Average Error: 0.1 → 0.1
Time: 8.9s
Precision: 64
$b \lt m$
$x \cdot \left(1 \cdot f - \frac{b}{m}\right)$
$x \cdot \left(1 \cdot f - \frac{b}{m}\right)$
x \cdot \left(1 \cdot f - \frac{b}{m}\right)
x \cdot \left(1 \cdot f - \frac{b}{m}\right)
double f(double x, double f, double b, double m) {
double r2493480 = x;
double r2493481 = 1.0;
double r2493482 = f;
double r2493483 = r2493481 * r2493482;
double r2493484 = b;
double r2493485 = m;
double r2493486 = r2493484 / r2493485;
double r2493487 = r2493483 - r2493486;
double r2493488 = r2493480 * r2493487;
return r2493488;
}


double f(double x, double f, double b, double m) {
double r2493489 = x;
double r2493490 = 1.0;
double r2493491 = f;
double r2493492 = r2493490 * r2493491;
double r2493493 = b;
double r2493494 = m;
double r2493495 = r2493493 / r2493494;
double r2493496 = r2493492 - r2493495;
double r2493497 = r2493489 * r2493496;
return r2493497;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.1

$x \cdot \left(1 \cdot f - \frac{b}{m}\right)$
2. Final simplification0.1

$\leadsto x \cdot \left(1 \cdot f - \frac{b}{m}\right)$

# Reproduce

herbie shell --seed 1
(FPCore (x f b m)
:name "x * (1.0f - (b/m))"
:precision binary32
:pre (< b m)
(* x (- (* 1 f) (/ b m))))