Average Error: 2.0 → 3.3
Time: 4.7s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{z}{t} \le -1.2041695756431433 \cdot 10^{-41}:\\ \;\;\;\;x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\\ \mathbf{elif}\;\frac{z}{t} \le 1.4822 \cdot 10^{-322}:\\ \;\;\;\;x + \left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \end{array}\]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \le -1.2041695756431433 \cdot 10^{-41}:\\
\;\;\;\;x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r565401 = x;
        double r565402 = y;
        double r565403 = r565402 - r565401;
        double r565404 = z;
        double r565405 = t;
        double r565406 = r565404 / r565405;
        double r565407 = r565403 * r565406;
        double r565408 = r565401 + r565407;
        return r565408;
}

double f(double x, double y, double z, double t) {
        double r565409 = z;
        double r565410 = t;
        double r565411 = r565409 / r565410;
        double r565412 = -1.2041695756431433e-41;
        bool r565413 = r565411 <= r565412;
        double r565414 = x;
        double r565415 = y;
        double r565416 = r565415 - r565414;
        double r565417 = cbrt(r565410);
        double r565418 = r565417 * r565417;
        double r565419 = r565416 / r565418;
        double r565420 = r565409 / r565417;
        double r565421 = r565419 * r565420;
        double r565422 = r565414 + r565421;
        double r565423 = 1.4821969375237e-322;
        bool r565424 = r565411 <= r565423;
        double r565425 = r565416 * r565409;
        double r565426 = 1.0;
        double r565427 = r565426 / r565410;
        double r565428 = r565425 * r565427;
        double r565429 = r565414 + r565428;
        double r565430 = r565416 * r565411;
        double r565431 = r565414 + r565430;
        double r565432 = r565424 ? r565429 : r565431;
        double r565433 = r565413 ? r565422 : r565432;
        return r565433;
}

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
Herbie3.3
\[\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 (/ z t) < -1.2041695756431433e-41

    1. Initial program 3.5

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

      \[\leadsto x + \left(y - x\right) \cdot \frac{z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}\]
    4. Applied *-un-lft-identity4.5

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

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

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right) \cdot \frac{z}{\sqrt[3]{t}}}\]
    7. Simplified7.0

      \[\leadsto x + \color{blue}{\frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{t}}\]

    if -1.2041695756431433e-41 < (/ z t) < 1.4821969375237e-322

    1. Initial program 1.4

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

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

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

    if 1.4821969375237e-322 < (/ z t)

    1. Initial program 1.8

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification3.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \le -1.2041695756431433 \cdot 10^{-41}:\\ \;\;\;\;x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\\ \mathbf{elif}\;\frac{z}{t} \le 1.4822 \cdot 10^{-322}:\\ \;\;\;\;x + \left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \end{array}\]

Reproduce

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