Average Error: 6.7 → 2.0
Time: 3.2s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.4044700134612323 \cdot 10^{-166}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{elif}\;x \le 1.2504527807439046 \cdot 10^{-147}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{y - x}{\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}}}{\frac{\sqrt[3]{t}}{\sqrt[3]{z}}}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot z}{t}
\begin{array}{l}
\mathbf{if}\;x \le -4.4044700134612323 \cdot 10^{-166}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\

\mathbf{elif}\;x \le 1.2504527807439046 \cdot 10^{-147}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r564154 = x;
        double r564155 = y;
        double r564156 = r564155 - r564154;
        double r564157 = z;
        double r564158 = r564156 * r564157;
        double r564159 = t;
        double r564160 = r564158 / r564159;
        double r564161 = r564154 + r564160;
        return r564161;
}

double f(double x, double y, double z, double t) {
        double r564162 = x;
        double r564163 = -4.404470013461232e-166;
        bool r564164 = r564162 <= r564163;
        double r564165 = y;
        double r564166 = r564165 - r564162;
        double r564167 = z;
        double r564168 = t;
        double r564169 = r564167 / r564168;
        double r564170 = r564166 * r564169;
        double r564171 = r564162 + r564170;
        double r564172 = 1.2504527807439046e-147;
        bool r564173 = r564162 <= r564172;
        double r564174 = r564166 / r564168;
        double r564175 = r564174 * r564167;
        double r564176 = r564162 + r564175;
        double r564177 = cbrt(r564168);
        double r564178 = r564177 * r564177;
        double r564179 = cbrt(r564167);
        double r564180 = r564179 * r564179;
        double r564181 = r564178 / r564180;
        double r564182 = r564166 / r564181;
        double r564183 = r564177 / r564179;
        double r564184 = r564182 / r564183;
        double r564185 = r564162 + r564184;
        double r564186 = r564173 ? r564176 : r564185;
        double r564187 = r564164 ? r564171 : r564186;
        return r564187;
}

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

Original6.7
Target1.9
Herbie2.0
\[\begin{array}{l} \mathbf{if}\;x \lt -9.0255111955330046 \cdot 10^{-135}:\\ \;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\ \mathbf{elif}\;x \lt 4.2750321637007147 \cdot 10^{-250}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if x < -4.404470013461232e-166

    1. Initial program 7.6

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

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

      \[\leadsto x + \color{blue}{\frac{y - x}{1} \cdot \frac{z}{t}}\]
    5. Simplified0.8

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

    if -4.404470013461232e-166 < x < 1.2504527807439046e-147

    1. Initial program 5.1

      \[x + \frac{\left(y - x\right) \cdot z}{t}\]
    2. Using strategy rm
    3. Applied associate-/l*5.1

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
    4. Using strategy rm
    5. Applied associate-/r/5.5

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

    if 1.2504527807439046e-147 < x

    1. Initial program 7.0

      \[x + \frac{\left(y - x\right) \cdot z}{t}\]
    2. Using strategy rm
    3. Applied associate-/l*0.5

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt0.9

      \[\leadsto x + \frac{y - x}{\frac{t}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}}\]
    6. Applied add-cube-cbrt1.0

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

      \[\leadsto x + \frac{y - x}{\color{blue}{\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt[3]{t}}{\sqrt[3]{z}}}}\]
    8. Applied associate-/r*0.7

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

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

Reproduce

herbie shell --seed 2020021 
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))

  (+ x (/ (* (- y x) z) t)))