Average Error: 33.1 → 0
Time: 4.1s
Precision: 64
$\left(h - \ell\right) \cdot \frac{r - \ell}{h - \ell} + \ell$
$r$
\left(h - \ell\right) \cdot \frac{r - \ell}{h - \ell} + \ell
r
double f(double h, double l, double r) {
double r279003 = h;
double r279004 = l;
double r279005 = r279003 - r279004;
double r279006 = r;
double r279007 = r279006 - r279004;
double r279008 = r279007 / r279005;
double r279009 = r279005 * r279008;
double r279010 = r279009 + r279004;
return r279010;
}


double f(double __attribute__((unused)) h, double __attribute__((unused)) l, double r) {
double r279011 = r;
return r279011;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 33.1

$\left(h - \ell\right) \cdot \frac{r - \ell}{h - \ell} + \ell$
2. Simplified0

$\leadsto \color{blue}{r - 0}$
3. Final simplification0

$\leadsto r$

# Reproduce

herbie shell --seed 1
(FPCore (h l r)
:name "(h -l) * ((r - l) / ( h - l) ) + l"
:precision binary64
(+ (* (- h l) (/ (- r l) (- h l))) l))