Average Error: 1.2 → 1.2
Time: 5.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 r552082 = x;
        double r552083 = y;
        double r552084 = z;
        double r552085 = t;
        double r552086 = r552084 - r552085;
        double r552087 = a;
        double r552088 = r552087 - r552085;
        double r552089 = r552086 / r552088;
        double r552090 = r552083 * r552089;
        double r552091 = r552082 + r552090;
        return r552091;
}

double f(double x, double y, double z, double t, double a) {
        double r552092 = x;
        double r552093 = y;
        double r552094 = z;
        double r552095 = t;
        double r552096 = r552094 - r552095;
        double r552097 = a;
        double r552098 = r552097 - r552095;
        double r552099 = r552096 / r552098;
        double r552100 = r552093 * r552099;
        double r552101 = r552092 + r552100;
        return r552101;
}

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.5
Herbie1.2
\[\begin{array}{l} \mathbf{if}\;y \lt -8.50808486055124107 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.8944268627920891 \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 2020064 
(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.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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