Average Error: 1.5 → 1.6
Time: 14.6s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right)\]
x + y \cdot \frac{z - t}{a - t}
x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right)
double f(double x, double y, double z, double t, double a) {
        double r451784 = x;
        double r451785 = y;
        double r451786 = z;
        double r451787 = t;
        double r451788 = r451786 - r451787;
        double r451789 = a;
        double r451790 = r451789 - r451787;
        double r451791 = r451788 / r451790;
        double r451792 = r451785 * r451791;
        double r451793 = r451784 + r451792;
        return r451793;
}

double f(double x, double y, double z, double t, double a) {
        double r451794 = x;
        double r451795 = y;
        double r451796 = z;
        double r451797 = t;
        double r451798 = r451796 - r451797;
        double r451799 = 1.0;
        double r451800 = a;
        double r451801 = r451800 - r451797;
        double r451802 = r451799 / r451801;
        double r451803 = r451798 * r451802;
        double r451804 = r451795 * r451803;
        double r451805 = r451794 + r451804;
        return r451805;
}

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.6
\[\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. Using strategy rm
  3. Applied div-inv1.6

    \[\leadsto x + y \cdot \color{blue}{\left(\left(z - t\right) \cdot \frac{1}{a - t}\right)}\]
  4. Final simplification1.6

    \[\leadsto x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right)\]

Reproduce

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