Average Error: 2.3 → 1.5
Time: 13.6s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{z}{t} = -\infty:\\ \;\;\;\;x - \frac{1}{t} \cdot \left(\left(x - y\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{x - y}{\frac{t}{z}}\\ \end{array}\]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} = -\infty:\\
\;\;\;\;x - \frac{1}{t} \cdot \left(\left(x - y\right) \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;x - \frac{x - y}{\frac{t}{z}}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r437465 = x;
        double r437466 = y;
        double r437467 = r437466 - r437465;
        double r437468 = z;
        double r437469 = t;
        double r437470 = r437468 / r437469;
        double r437471 = r437467 * r437470;
        double r437472 = r437465 + r437471;
        return r437472;
}

double f(double x, double y, double z, double t) {
        double r437473 = z;
        double r437474 = t;
        double r437475 = r437473 / r437474;
        double r437476 = -inf.0;
        bool r437477 = r437475 <= r437476;
        double r437478 = x;
        double r437479 = 1.0;
        double r437480 = r437479 / r437474;
        double r437481 = y;
        double r437482 = r437478 - r437481;
        double r437483 = r437482 * r437473;
        double r437484 = r437480 * r437483;
        double r437485 = r437478 - r437484;
        double r437486 = r437474 / r437473;
        double r437487 = r437482 / r437486;
        double r437488 = r437478 - r437487;
        double r437489 = r437477 ? r437485 : r437488;
        return r437489;
}

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

Original2.3
Target2.5
Herbie1.5
\[\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 2 regimes
  2. if (/ z t) < -inf.0

    1. Initial program 64.0

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

      \[\leadsto \color{blue}{x - \frac{z}{t} \cdot \left(x - y\right)}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity64.0

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

      \[\leadsto x - \color{blue}{1 \cdot \left(\frac{z}{t} \cdot \left(x - y\right)\right)}\]
    6. Simplified60.0

      \[\leadsto x - 1 \cdot \color{blue}{\frac{x - y}{\frac{t}{z}}}\]
    7. Using strategy rm
    8. Applied div-inv60.0

      \[\leadsto x - 1 \cdot \frac{x - y}{\color{blue}{t \cdot \frac{1}{z}}}\]
    9. Applied *-un-lft-identity60.0

      \[\leadsto x - 1 \cdot \frac{\color{blue}{1 \cdot \left(x - y\right)}}{t \cdot \frac{1}{z}}\]
    10. Applied times-frac0.5

      \[\leadsto x - 1 \cdot \color{blue}{\left(\frac{1}{t} \cdot \frac{x - y}{\frac{1}{z}}\right)}\]
    11. Simplified0.4

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

    if -inf.0 < (/ z t)

    1. Initial program 1.5

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

      \[\leadsto \color{blue}{x - \frac{z}{t} \cdot \left(x - y\right)}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity1.5

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} = -\infty:\\ \;\;\;\;x - \frac{1}{t} \cdot \left(\left(x - y\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{x - y}{\frac{t}{z}}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< (* (- y x) (/ z t)) -1013646692435.8867) (+ 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))))