Average Error: 11.3 → 1.3
Time: 4.7s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[x + \frac{\frac{y - z}{a - z}}{\frac{1}{t}}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
x + \frac{\frac{y - z}{a - z}}{\frac{1}{t}}
double f(double x, double y, double z, double t, double a) {
        double r671276 = x;
        double r671277 = y;
        double r671278 = z;
        double r671279 = r671277 - r671278;
        double r671280 = t;
        double r671281 = r671279 * r671280;
        double r671282 = a;
        double r671283 = r671282 - r671278;
        double r671284 = r671281 / r671283;
        double r671285 = r671276 + r671284;
        return r671285;
}

double f(double x, double y, double z, double t, double a) {
        double r671286 = x;
        double r671287 = y;
        double r671288 = z;
        double r671289 = r671287 - r671288;
        double r671290 = a;
        double r671291 = r671290 - r671288;
        double r671292 = r671289 / r671291;
        double r671293 = 1.0;
        double r671294 = t;
        double r671295 = r671293 / r671294;
        double r671296 = r671292 / r671295;
        double r671297 = r671286 + r671296;
        return r671297;
}

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.3
Target0.5
Herbie1.3
\[\begin{array}{l} \mathbf{if}\;t \lt -1.068297449017406694366747246993994850729 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.911094988758637497591020599238553861375 \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.3

    \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
  2. Using strategy rm
  3. Applied associate-/l*3.0

    \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}}\]
  4. Using strategy rm
  5. Applied div-inv3.0

    \[\leadsto x + \frac{y - z}{\color{blue}{\left(a - z\right) \cdot \frac{1}{t}}}\]
  6. Applied associate-/r*1.3

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

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

Reproduce

herbie shell --seed 2019353 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
  :precision binary64

  :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))))