Average Error: 11.2 → 1.1
Time: 49.7s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[x + \frac{t}{\frac{a - z}{y - z}}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
x + \frac{t}{\frac{a - z}{y - z}}
double f(double x, double y, double z, double t, double a) {
        double r22593281 = x;
        double r22593282 = y;
        double r22593283 = z;
        double r22593284 = r22593282 - r22593283;
        double r22593285 = t;
        double r22593286 = r22593284 * r22593285;
        double r22593287 = a;
        double r22593288 = r22593287 - r22593283;
        double r22593289 = r22593286 / r22593288;
        double r22593290 = r22593281 + r22593289;
        return r22593290;
}

double f(double x, double y, double z, double t, double a) {
        double r22593291 = x;
        double r22593292 = t;
        double r22593293 = a;
        double r22593294 = z;
        double r22593295 = r22593293 - r22593294;
        double r22593296 = y;
        double r22593297 = r22593296 - r22593294;
        double r22593298 = r22593295 / r22593297;
        double r22593299 = r22593292 / r22593298;
        double r22593300 = r22593291 + r22593299;
        return r22593300;
}

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

Original11.2
Target0.5
Herbie1.1
\[\begin{array}{l} \mathbf{if}\;t \lt -1.0682974490174067 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.9110949887586375 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array}\]

Derivation

  1. Initial program 11.2

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(t, \frac{y - z}{a - z}, x\right)}\]
  3. Using strategy rm
  4. Applied fma-udef1.2

    \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z} + x}\]
  5. Using strategy rm
  6. Applied clear-num1.2

    \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{a - z}{y - z}}} + x\]
  7. Using strategy rm
  8. Applied *-un-lft-identity1.2

    \[\leadsto \color{blue}{\left(1 \cdot t\right)} \cdot \frac{1}{\frac{a - z}{y - z}} + x\]
  9. Applied associate-*l*1.2

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

    \[\leadsto 1 \cdot \color{blue}{\frac{t}{\frac{a - z}{y - z}}} + x\]
  11. Final simplification1.1

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

Reproduce

herbie shell --seed 2019165 +o rules:numerics
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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