Average Error: 10.5 → 1.6
Time: 14.3s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\left(y - z\right) \cdot x}{t - z} \le -2.9743738529439008 \cdot 10^{+273}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \mathbf{elif}\;\frac{\left(y - z\right) \cdot x}{t - z} \le 3.4474718287681383 \cdot 10^{+211}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;\frac{\left(y - z\right) \cdot x}{t - z} \le -2.9743738529439008 \cdot 10^{+273}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r28463128 = x;
        double r28463129 = y;
        double r28463130 = z;
        double r28463131 = r28463129 - r28463130;
        double r28463132 = r28463128 * r28463131;
        double r28463133 = t;
        double r28463134 = r28463133 - r28463130;
        double r28463135 = r28463132 / r28463134;
        return r28463135;
}

double f(double x, double y, double z, double t) {
        double r28463136 = y;
        double r28463137 = z;
        double r28463138 = r28463136 - r28463137;
        double r28463139 = x;
        double r28463140 = r28463138 * r28463139;
        double r28463141 = t;
        double r28463142 = r28463141 - r28463137;
        double r28463143 = r28463140 / r28463142;
        double r28463144 = -2.9743738529439008e+273;
        bool r28463145 = r28463143 <= r28463144;
        double r28463146 = r28463141 / r28463138;
        double r28463147 = r28463137 / r28463138;
        double r28463148 = r28463146 - r28463147;
        double r28463149 = r28463139 / r28463148;
        double r28463150 = 3.4474718287681383e+211;
        bool r28463151 = r28463143 <= r28463150;
        double r28463152 = r28463138 / r28463142;
        double r28463153 = r28463139 * r28463152;
        double r28463154 = r28463151 ? r28463143 : r28463153;
        double r28463155 = r28463145 ? r28463149 : r28463154;
        return r28463155;
}

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

Original10.5
Target2.2
Herbie1.6
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* x (- y z)) (- t z)) < -2.9743738529439008e+273

    1. Initial program 54.4

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

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

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

    if -2.9743738529439008e+273 < (/ (* x (- y z)) (- t z)) < 3.4474718287681383e+211

    1. Initial program 1.4

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

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

      \[\leadsto \frac{x}{\color{blue}{\frac{t}{y - z} - \frac{z}{y - z}}}\]
    6. Using strategy rm
    7. Applied div-inv2.3

      \[\leadsto \frac{x}{\frac{t}{y - z} - \color{blue}{z \cdot \frac{1}{y - z}}}\]
    8. Applied div-inv2.3

      \[\leadsto \frac{x}{\color{blue}{t \cdot \frac{1}{y - z}} - z \cdot \frac{1}{y - z}}\]
    9. Applied distribute-rgt-out--2.3

      \[\leadsto \frac{x}{\color{blue}{\frac{1}{y - z} \cdot \left(t - z\right)}}\]
    10. Applied associate-/r*1.5

      \[\leadsto \color{blue}{\frac{\frac{x}{\frac{1}{y - z}}}{t - z}}\]
    11. Simplified1.4

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

    if 3.4474718287681383e+211 < (/ (* x (- y z)) (- t z))

    1. Initial program 46.3

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

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

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y - z}{t - z}}\]
    5. Simplified2.9

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

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

Reproduce

herbie shell --seed 2019158 +o rules:numerics
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"

  :herbie-target
  (/ x (/ (- t z) (- y z)))

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