Average Error: 1.9 → 1.7
Time: 26.7s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.047175136097081519567752708262470407136 \cdot 10^{-78} \lor \neg \left(x \le 9.154341385217706472095092298477914687705 \cdot 10^{-201}\right):\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(y - x\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right) \cdot \frac{\sqrt[3]{z}}{t}\\ \end{array}\]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
\mathbf{if}\;x \le -1.047175136097081519567752708262470407136 \cdot 10^{-78} \lor \neg \left(x \le 9.154341385217706472095092298477914687705 \cdot 10^{-201}\right):\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r1032672 = x;
        double r1032673 = y;
        double r1032674 = r1032673 - r1032672;
        double r1032675 = z;
        double r1032676 = t;
        double r1032677 = r1032675 / r1032676;
        double r1032678 = r1032674 * r1032677;
        double r1032679 = r1032672 + r1032678;
        return r1032679;
}

double f(double x, double y, double z, double t) {
        double r1032680 = x;
        double r1032681 = -1.0471751360970815e-78;
        bool r1032682 = r1032680 <= r1032681;
        double r1032683 = 9.154341385217706e-201;
        bool r1032684 = r1032680 <= r1032683;
        double r1032685 = !r1032684;
        bool r1032686 = r1032682 || r1032685;
        double r1032687 = y;
        double r1032688 = r1032687 - r1032680;
        double r1032689 = z;
        double r1032690 = t;
        double r1032691 = r1032689 / r1032690;
        double r1032692 = r1032688 * r1032691;
        double r1032693 = r1032680 + r1032692;
        double r1032694 = cbrt(r1032689);
        double r1032695 = r1032694 * r1032694;
        double r1032696 = r1032688 * r1032695;
        double r1032697 = r1032694 / r1032690;
        double r1032698 = r1032696 * r1032697;
        double r1032699 = r1032680 + r1032698;
        double r1032700 = r1032686 ? r1032693 : r1032699;
        return r1032700;
}

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.2
Herbie1.7
\[\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 x < -1.0471751360970815e-78 or 9.154341385217706e-201 < x

    1. Initial program 0.8

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

    if -1.0471751360970815e-78 < x < 9.154341385217706e-201

    1. Initial program 4.4

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

      \[\leadsto x + \left(y - x\right) \cdot \frac{z}{\color{blue}{1 \cdot t}}\]
    4. Applied add-cube-cbrt5.1

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.047175136097081519567752708262470407136 \cdot 10^{-78} \lor \neg \left(x \le 9.154341385217706472095092298477914687705 \cdot 10^{-201}\right):\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(y - x\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right) \cdot \frac{\sqrt[3]{z}}{t}\\ \end{array}\]

Reproduce

herbie shell --seed 2019303 +o rules:numerics
(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))))