Average Error: 1.5 → 1.5
Time: 13.7s
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 r741659 = x;
        double r741660 = y;
        double r741661 = z;
        double r741662 = t;
        double r741663 = r741661 - r741662;
        double r741664 = a;
        double r741665 = r741664 - r741662;
        double r741666 = r741663 / r741665;
        double r741667 = r741660 * r741666;
        double r741668 = r741659 + r741667;
        return r741668;
}

double f(double x, double y, double z, double t, double a) {
        double r741669 = x;
        double r741670 = y;
        double r741671 = z;
        double r741672 = t;
        double r741673 = r741671 - r741672;
        double r741674 = a;
        double r741675 = r741674 - r741672;
        double r741676 = r741673 / r741675;
        double r741677 = r741670 * r741676;
        double r741678 = r741669 + r741677;
        return r741678;
}

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

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

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

Reproduce

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

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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