Average Error: 6.6 → 2.5
Time: 4.6s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -2409170190487766637167962488832:\\ \;\;\;\;x + \frac{\frac{y - x}{t}}{\frac{1}{z}}\\ \mathbf{elif}\;t \le 1.625406329571911990929648461559105916592 \cdot 10^{-217}:\\ \;\;\;\;x + \left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\\ \end{array}\]
x + \frac{\left(y - x\right) \cdot z}{t}
\begin{array}{l}
\mathbf{if}\;t \le -2409170190487766637167962488832:\\
\;\;\;\;x + \frac{\frac{y - x}{t}}{\frac{1}{z}}\\

\mathbf{elif}\;t \le 1.625406329571911990929648461559105916592 \cdot 10^{-217}:\\
\;\;\;\;x + \left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{t}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r577103 = x;
        double r577104 = y;
        double r577105 = r577104 - r577103;
        double r577106 = z;
        double r577107 = r577105 * r577106;
        double r577108 = t;
        double r577109 = r577107 / r577108;
        double r577110 = r577103 + r577109;
        return r577110;
}

double f(double x, double y, double z, double t) {
        double r577111 = t;
        double r577112 = -2.4091701904877666e+30;
        bool r577113 = r577111 <= r577112;
        double r577114 = x;
        double r577115 = y;
        double r577116 = r577115 - r577114;
        double r577117 = r577116 / r577111;
        double r577118 = 1.0;
        double r577119 = z;
        double r577120 = r577118 / r577119;
        double r577121 = r577117 / r577120;
        double r577122 = r577114 + r577121;
        double r577123 = 1.625406329571912e-217;
        bool r577124 = r577111 <= r577123;
        double r577125 = r577116 * r577119;
        double r577126 = r577118 / r577111;
        double r577127 = r577125 * r577126;
        double r577128 = r577114 + r577127;
        double r577129 = cbrt(r577111);
        double r577130 = r577129 * r577129;
        double r577131 = r577116 / r577130;
        double r577132 = r577119 / r577129;
        double r577133 = r577131 * r577132;
        double r577134 = r577114 + r577133;
        double r577135 = r577124 ? r577128 : r577134;
        double r577136 = r577113 ? r577122 : r577135;
        return r577136;
}

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.6
Target2.0
Herbie2.5
\[\begin{array}{l} \mathbf{if}\;x \lt -9.025511195533004570453352523209034680317 \cdot 10^{-135}:\\ \;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\ \mathbf{elif}\;x \lt 4.275032163700714748507147332551979944314 \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 t < -2.4091701904877666e+30

    1. Initial program 10.3

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

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
    4. Using strategy rm
    5. Applied div-inv1.4

      \[\leadsto x + \frac{y - x}{\color{blue}{t \cdot \frac{1}{z}}}\]
    6. Applied associate-/r*1.2

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

    if -2.4091701904877666e+30 < t < 1.625406329571912e-217

    1. Initial program 1.9

      \[x + \frac{\left(y - x\right) \cdot z}{t}\]
    2. Using strategy rm
    3. Applied div-inv1.9

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

    if 1.625406329571912e-217 < t

    1. Initial program 6.8

      \[x + \frac{\left(y - x\right) \cdot z}{t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt7.2

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

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

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

Reproduce

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