Average Error: 1.4 → 1.4
Time: 4.2s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + \left(\frac{z}{a - t} - \frac{t}{a - t}\right) \cdot y\]
x + y \cdot \frac{z - t}{a - t}
x + \left(\frac{z}{a - t} - \frac{t}{a - t}\right) \cdot y
double f(double x, double y, double z, double t, double a) {
        double r592174 = x;
        double r592175 = y;
        double r592176 = z;
        double r592177 = t;
        double r592178 = r592176 - r592177;
        double r592179 = a;
        double r592180 = r592179 - r592177;
        double r592181 = r592178 / r592180;
        double r592182 = r592175 * r592181;
        double r592183 = r592174 + r592182;
        return r592183;
}

double f(double x, double y, double z, double t, double a) {
        double r592184 = x;
        double r592185 = z;
        double r592186 = a;
        double r592187 = t;
        double r592188 = r592186 - r592187;
        double r592189 = r592185 / r592188;
        double r592190 = r592187 / r592188;
        double r592191 = r592189 - r592190;
        double r592192 = y;
        double r592193 = r592191 * r592192;
        double r592194 = r592184 + r592193;
        return r592194;
}

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.50808486055124107 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.8944268627920891 \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 div-sub1.4

    \[\leadsto x + y \cdot \color{blue}{\left(\frac{z}{a - t} - \frac{t}{a - t}\right)}\]
  4. Using strategy rm
  5. Applied *-commutative1.4

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

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

Reproduce

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