Average Error: 1.3 → 1.2
Time: 16.2s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + \frac{y}{\frac{a - t}{z - t}}\]
x + y \cdot \frac{z - t}{a - t}
x + \frac{y}{\frac{a - t}{z - t}}
double f(double x, double y, double z, double t, double a) {
        double r289727 = x;
        double r289728 = y;
        double r289729 = z;
        double r289730 = t;
        double r289731 = r289729 - r289730;
        double r289732 = a;
        double r289733 = r289732 - r289730;
        double r289734 = r289731 / r289733;
        double r289735 = r289728 * r289734;
        double r289736 = r289727 + r289735;
        return r289736;
}

double f(double x, double y, double z, double t, double a) {
        double r289737 = x;
        double r289738 = y;
        double r289739 = a;
        double r289740 = t;
        double r289741 = r289739 - r289740;
        double r289742 = z;
        double r289743 = r289742 - r289740;
        double r289744 = r289741 / r289743;
        double r289745 = r289738 / r289744;
        double r289746 = r289737 + r289745;
        return r289746;
}

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

    \[x + y \cdot \frac{z - t}{a - t}\]
  2. Using strategy rm
  3. Applied pow11.3

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

    \[\leadsto x + \color{blue}{{y}^{1}} \cdot {\left(\frac{z - t}{a - t}\right)}^{1}\]
  5. Applied pow-prod-down1.3

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

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

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

Reproduce

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