Average Error: 1.9 → 1.9
Time: 5.7s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[x + \frac{y - x}{\frac{t}{z}}\]
x + \left(y - x\right) \cdot \frac{z}{t}
x + \frac{y - x}{\frac{t}{z}}
double f(double x, double y, double z, double t) {
        double r433716 = x;
        double r433717 = y;
        double r433718 = r433717 - r433716;
        double r433719 = z;
        double r433720 = t;
        double r433721 = r433719 / r433720;
        double r433722 = r433718 * r433721;
        double r433723 = r433716 + r433722;
        return r433723;
}

double f(double x, double y, double z, double t) {
        double r433724 = x;
        double r433725 = y;
        double r433726 = r433725 - r433724;
        double r433727 = t;
        double r433728 = z;
        double r433729 = r433727 / r433728;
        double r433730 = r433726 / r433729;
        double r433731 = r433724 + r433730;
        return r433731;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.9
Target2.1
Herbie1.9
\[\begin{array}{l} \mathbf{if}\;\left(y - x\right) \cdot \frac{z}{t} \lt -1013646692435.88671875:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \mathbf{elif}\;\left(y - x\right) \cdot \frac{z}{t} \lt -0.0:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if t < -3.542613364473471e-276

    1. Initial program 1.8

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

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

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
    6. Using strategy rm
    7. Applied clear-num1.8

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

    if -3.542613364473471e-276 < t < 4.428168098827568e+65

    1. Initial program 3.0

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

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

    if 4.428168098827568e+65 < t

    1. Initial program 1.2

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

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

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.9

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

Reproduce

herbie shell --seed 2019308 
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
  :precision binary64

  :herbie-target
  (if (< (* (- y x) (/ z t)) -1013646692435.887) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) -0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))

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