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 r279134 = h;
        double r279135 = l;
        double r279136 = r279134 - r279135;
        double r279137 = r;
        double r279138 = r279137 - r279135;
        double r279139 = r279138 / r279136;
        double r279140 = r279136 * r279139;
        double r279141 = r279140 + r279135;
        return r279141;
}

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

Error

Bits error versus h

Bits error versus l

Bits error versus r

Try it out

Your Program's Arguments

Results

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))