Average Error: 0.0 → 0.0
Time: 8.6s
Precision: 64
$\left(f - 1\right) \cdot \left(1 - \frac{b}{m}\right)$
$1 \cdot \left(f - 1\right) + \left(f - 1\right) \cdot \left(-\frac{b}{m}\right)$
\left(f - 1\right) \cdot \left(1 - \frac{b}{m}\right)
1 \cdot \left(f - 1\right) + \left(f - 1\right) \cdot \left(-\frac{b}{m}\right)
double f(double f, double b, double m) {
double r2492686 = f;
double r2492687 = 1.0;
double r2492688 = r2492686 - r2492687;
double r2492689 = b;
double r2492690 = m;
double r2492691 = r2492689 / r2492690;
double r2492692 = r2492687 - r2492691;
double r2492693 = r2492688 * r2492692;
return r2492693;
}


double f(double f, double b, double m) {
double r2492694 = 1.0;
double r2492695 = f;
double r2492696 = r2492695 - r2492694;
double r2492697 = r2492694 * r2492696;
double r2492698 = b;
double r2492699 = m;
double r2492700 = r2492698 / r2492699;
double r2492701 = -r2492700;
double r2492702 = r2492696 * r2492701;
double r2492703 = r2492697 + r2492702;
return r2492703;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$\left(f - 1\right) \cdot \left(1 - \frac{b}{m}\right)$
2. Using strategy rm
3. Applied sub-neg0.0

$\leadsto \left(f - 1\right) \cdot \color{blue}{\left(1 + \left(-\frac{b}{m}\right)\right)}$
4. Applied distribute-lft-in0.0

$\leadsto \color{blue}{\left(f - 1\right) \cdot 1 + \left(f - 1\right) \cdot \left(-\frac{b}{m}\right)}$
5. Simplified0.0

$\leadsto \color{blue}{1 \cdot \left(f - 1\right)} + \left(f - 1\right) \cdot \left(-\frac{b}{m}\right)$
6. Final simplification0.0

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

# Reproduce

herbie shell --seed 1
(FPCore (f b m)
:name "(f-1)*(1.0-b/m)"
:precision binary64
(* (- f 1) (- 1 (/ b m))))