Average Error: 2.1 → 2.0
Time: 18.8s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.805118041439937941139552230088477979341 \cdot 10^{-286}:\\ \;\;\;\;x + \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{elif}\;x \le 9.722960166984673180429226333422988982195 \cdot 10^{-97}:\\ \;\;\;\;\frac{\sqrt[3]{z}}{t} \cdot \left(\left(\left(y - x\right) \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}\right) + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{t} \cdot \left(y - x\right)\\ \end{array}\]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
\mathbf{if}\;x \le -2.805118041439937941139552230088477979341 \cdot 10^{-286}:\\
\;\;\;\;x + \frac{z}{t} \cdot \left(y - x\right)\\

\mathbf{elif}\;x \le 9.722960166984673180429226333422988982195 \cdot 10^{-97}:\\
\;\;\;\;\frac{\sqrt[3]{z}}{t} \cdot \left(\left(\left(y - x\right) \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}\right) + x\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r24350672 = x;
        double r24350673 = y;
        double r24350674 = r24350673 - r24350672;
        double r24350675 = z;
        double r24350676 = t;
        double r24350677 = r24350675 / r24350676;
        double r24350678 = r24350674 * r24350677;
        double r24350679 = r24350672 + r24350678;
        return r24350679;
}

double f(double x, double y, double z, double t) {
        double r24350680 = x;
        double r24350681 = -2.805118041439938e-286;
        bool r24350682 = r24350680 <= r24350681;
        double r24350683 = z;
        double r24350684 = t;
        double r24350685 = r24350683 / r24350684;
        double r24350686 = y;
        double r24350687 = r24350686 - r24350680;
        double r24350688 = r24350685 * r24350687;
        double r24350689 = r24350680 + r24350688;
        double r24350690 = 9.722960166984673e-97;
        bool r24350691 = r24350680 <= r24350690;
        double r24350692 = cbrt(r24350683);
        double r24350693 = r24350692 / r24350684;
        double r24350694 = r24350687 * r24350692;
        double r24350695 = r24350694 * r24350692;
        double r24350696 = r24350693 * r24350695;
        double r24350697 = r24350696 + r24350680;
        double r24350698 = r24350691 ? r24350697 : r24350689;
        double r24350699 = r24350682 ? r24350689 : r24350698;
        return r24350699;
}

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.1
Target2.3
Herbie2.0
\[\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 < -2.805118041439938e-286 or 9.722960166984673e-97 < x

    1. Initial program 1.3

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

    if -2.805118041439938e-286 < x < 9.722960166984673e-97

    1. Initial program 5.1

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

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

      \[\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.9

      \[\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*4.3

      \[\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. Simplified4.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -2.805118041439937941139552230088477979341 \cdot 10^{-286}:\\ \;\;\;\;x + \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{elif}\;x \le 9.722960166984673180429226333422988982195 \cdot 10^{-97}:\\ \;\;\;\;\frac{\sqrt[3]{z}}{t} \cdot \left(\left(\left(y - x\right) \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}\right) + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{t} \cdot \left(y - x\right)\\ \end{array}\]

Reproduce

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