Average Error: 2.0 → 3.3
Time: 5.4s
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 r621534 = x;
        double r621535 = y;
        double r621536 = r621535 - r621534;
        double r621537 = z;
        double r621538 = t;
        double r621539 = r621537 / r621538;
        double r621540 = r621536 * r621539;
        double r621541 = r621534 + r621540;
        return r621541;
}

double f(double x, double y, double z, double t) {
        double r621542 = z;
        double r621543 = t;
        double r621544 = r621542 / r621543;
        double r621545 = -1.2041695756431433e-41;
        bool r621546 = r621544 <= r621545;
        double r621547 = x;
        double r621548 = y;
        double r621549 = r621548 - r621547;
        double r621550 = cbrt(r621543);
        double r621551 = r621550 * r621550;
        double r621552 = r621549 / r621551;
        double r621553 = r621542 / r621550;
        double r621554 = r621552 * r621553;
        double r621555 = r621547 + r621554;
        double r621556 = 1.4821969375237e-322;
        bool r621557 = r621544 <= r621556;
        double r621558 = r621549 * r621542;
        double r621559 = 1.0;
        double r621560 = r621559 / r621543;
        double r621561 = r621558 * r621560;
        double r621562 = r621547 + r621561;
        double r621563 = r621549 * r621544;
        double r621564 = r621547 + r621563;
        double r621565 = r621557 ? r621562 : r621564;
        double r621566 = r621546 ? r621555 : r621565;
        return r621566;
}

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