Average Error: 2.2 → 2.2
Time: 12.0s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.01649379191452465 \cdot 10^{-92}:\\ \;\;\;\;x + \frac{z}{\frac{t}{y - x}}\\ \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}\;z \le -4.01649379191452465 \cdot 10^{-92}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y - x}}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r601830 = x;
        double r601831 = y;
        double r601832 = r601831 - r601830;
        double r601833 = z;
        double r601834 = t;
        double r601835 = r601833 / r601834;
        double r601836 = r601832 * r601835;
        double r601837 = r601830 + r601836;
        return r601837;
}

double f(double x, double y, double z, double t) {
        double r601838 = z;
        double r601839 = -4.0164937919145246e-92;
        bool r601840 = r601838 <= r601839;
        double r601841 = x;
        double r601842 = t;
        double r601843 = y;
        double r601844 = r601843 - r601841;
        double r601845 = r601842 / r601844;
        double r601846 = r601838 / r601845;
        double r601847 = r601841 + r601846;
        double r601848 = r601838 / r601842;
        double r601849 = r601844 * r601848;
        double r601850 = r601841 + r601849;
        double r601851 = r601840 ? r601847 : r601850;
        return r601851;
}

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.2
Target2.4
Herbie2.2
\[\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 2 regimes
  2. if z < -4.0164937919145246e-92

    1. Initial program 2.6

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]
    2. Taylor expanded around 0 10.3

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

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

    if -4.0164937919145246e-92 < z

    1. Initial program 2.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -4.01649379191452465 \cdot 10^{-92}:\\ \;\;\;\;x + \frac{z}{\frac{t}{y - x}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \end{array}\]

Reproduce

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