Average Error: 1.4 → 1.4
Time: 5.6s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + y \cdot \left(1 \cdot \frac{z - t}{a - t}\right)\]
x + y \cdot \frac{z - t}{a - t}
x + y \cdot \left(1 \cdot \frac{z - t}{a - t}\right)
double f(double x, double y, double z, double t, double a) {
        double r532739 = x;
        double r532740 = y;
        double r532741 = z;
        double r532742 = t;
        double r532743 = r532741 - r532742;
        double r532744 = a;
        double r532745 = r532744 - r532742;
        double r532746 = r532743 / r532745;
        double r532747 = r532740 * r532746;
        double r532748 = r532739 + r532747;
        return r532748;
}

double f(double x, double y, double z, double t, double a) {
        double r532749 = x;
        double r532750 = y;
        double r532751 = 1.0;
        double r532752 = z;
        double r532753 = t;
        double r532754 = r532752 - r532753;
        double r532755 = a;
        double r532756 = r532755 - r532753;
        double r532757 = r532754 / r532756;
        double r532758 = r532751 * r532757;
        double r532759 = r532750 * r532758;
        double r532760 = r532749 + r532759;
        return r532760;
}

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. Using strategy rm
  3. Applied *-un-lft-identity1.4

    \[\leadsto x + y \cdot \frac{z - t}{\color{blue}{1 \cdot \left(a - t\right)}}\]
  4. Applied *-un-lft-identity1.4

    \[\leadsto x + y \cdot \frac{\color{blue}{1 \cdot \left(z - t\right)}}{1 \cdot \left(a - t\right)}\]
  5. Applied times-frac1.4

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

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

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

Reproduce

herbie shell --seed 2020002 +o rules:numerics
(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)))))