Average Error: 1.4 → 1.4
Time: 11.4s
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 r622878 = x;
        double r622879 = y;
        double r622880 = z;
        double r622881 = t;
        double r622882 = r622880 - r622881;
        double r622883 = a;
        double r622884 = r622883 - r622881;
        double r622885 = r622882 / r622884;
        double r622886 = r622879 * r622885;
        double r622887 = r622878 + r622886;
        return r622887;
}

double f(double x, double y, double z, double t, double a) {
        double r622888 = x;
        double r622889 = y;
        double r622890 = z;
        double r622891 = t;
        double r622892 = r622890 - r622891;
        double r622893 = a;
        double r622894 = r622893 - r622891;
        double r622895 = r622892 / r622894;
        double r622896 = r622889 * r622895;
        double r622897 = r622888 + r622896;
        return r622897;
}

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.4
Target0.5
Herbie1.4
\[\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.4

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

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

Reproduce

herbie shell --seed 2019350 
(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)))))