Average Error: 2.0 → 0.9
Time: 5.5s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;x + \left(y - x\right) \cdot \frac{z}{t} = -\infty:\\ \;\;\;\;x + \left(\frac{z \cdot y}{t} - \frac{x \cdot z}{t}\right)\\ \mathbf{elif}\;x + \left(y - x\right) \cdot \frac{z}{t} \le 3.2292290958892944 \cdot 10^{304}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{t}\\ \end{array}\]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
\mathbf{if}\;x + \left(y - x\right) \cdot \frac{z}{t} = -\infty:\\
\;\;\;\;x + \left(\frac{z \cdot y}{t} - \frac{x \cdot z}{t}\right)\\

\mathbf{elif}\;x + \left(y - x\right) \cdot \frac{z}{t} \le 3.2292290958892944 \cdot 10^{304}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;x + \left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{t}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r1097281 = x;
        double r1097282 = y;
        double r1097283 = r1097282 - r1097281;
        double r1097284 = z;
        double r1097285 = t;
        double r1097286 = r1097284 / r1097285;
        double r1097287 = r1097283 * r1097286;
        double r1097288 = r1097281 + r1097287;
        return r1097288;
}

double f(double x, double y, double z, double t) {
        double r1097289 = x;
        double r1097290 = y;
        double r1097291 = r1097290 - r1097289;
        double r1097292 = z;
        double r1097293 = t;
        double r1097294 = r1097292 / r1097293;
        double r1097295 = r1097291 * r1097294;
        double r1097296 = r1097289 + r1097295;
        double r1097297 = -inf.0;
        bool r1097298 = r1097296 <= r1097297;
        double r1097299 = r1097292 * r1097290;
        double r1097300 = r1097299 / r1097293;
        double r1097301 = r1097289 * r1097292;
        double r1097302 = r1097301 / r1097293;
        double r1097303 = r1097300 - r1097302;
        double r1097304 = r1097289 + r1097303;
        double r1097305 = 3.2292290958892944e+304;
        bool r1097306 = r1097296 <= r1097305;
        double r1097307 = r1097291 * r1097292;
        double r1097308 = 1.0;
        double r1097309 = r1097308 / r1097293;
        double r1097310 = r1097307 * r1097309;
        double r1097311 = r1097289 + r1097310;
        double r1097312 = r1097306 ? r1097296 : r1097311;
        double r1097313 = r1097298 ? r1097304 : r1097312;
        return r1097313;
}

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.0
Target2.2
Herbie0.9
\[\begin{array}{l} \mathbf{if}\;\left(y - x\right) \cdot \frac{z}{t} \lt -1013646692435.887:\\ \;\;\;\;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 (+ x (* (- y x) (/ z t))) < -inf.0

    1. Initial program 64.0

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt64.0

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

      \[\leadsto x + \color{blue}{\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{y - x} \cdot \frac{z}{t}\right)}\]
    5. Taylor expanded around 0 0.3

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

    if -inf.0 < (+ x (* (- y x) (/ z t))) < 3.2292290958892944e+304

    1. Initial program 0.8

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

    if 3.2292290958892944e+304 < (+ x (* (- y x) (/ z t)))

    1. Initial program 45.0

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]
    2. Using strategy rm
    3. Applied div-inv45.0

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

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{t}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.9

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

Reproduce

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