Average Error: 1.2 → 1.2
Time: 9.0s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + y \cdot \frac{z - t}{a - t}\]
x + y \cdot \frac{z - t}{a - t}
x + y \cdot \frac{z - t}{a - t}
double f(double x, double y, double z, double t, double a) {
        double r356744 = x;
        double r356745 = y;
        double r356746 = z;
        double r356747 = t;
        double r356748 = r356746 - r356747;
        double r356749 = a;
        double r356750 = r356749 - r356747;
        double r356751 = r356748 / r356750;
        double r356752 = r356745 * r356751;
        double r356753 = r356744 + r356752;
        return r356753;
}

double f(double x, double y, double z, double t, double a) {
        double r356754 = x;
        double r356755 = y;
        double r356756 = z;
        double r356757 = t;
        double r356758 = r356756 - r356757;
        double r356759 = a;
        double r356760 = r356759 - r356757;
        double r356761 = r356758 / r356760;
        double r356762 = r356755 * r356761;
        double r356763 = r356754 + r356762;
        return r356763;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.2
Target0.4
Herbie1.2
\[\begin{array}{l} \mathbf{if}\;y \lt -8.508084860551241069024247453646278348229 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.894426862792089097262541964056085749132 \cdot 10^{-49}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Initial program 1.2

    \[x + y \cdot \frac{z - t}{a - t}\]
  2. Final simplification1.2

    \[\leadsto x + y \cdot \frac{z - t}{a - t}\]

Reproduce

herbie shell --seed 2019304 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (if (< y -8.50808486055124107e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.8944268627920891e-49) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

  (+ x (* y (/ (- z t) (- a t)))))