Average Error: 11.3 → 2.4
Time: 8.8s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.3901733726023231 \cdot 10^{33}:\\ \;\;\;\;\frac{x}{t \cdot \frac{1}{y - z} - \frac{z}{y - z}}\\ \mathbf{elif}\;z \le -1.7069294686818465 \cdot 10^{-261}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le -1.3901733726023231 \cdot 10^{33}:\\
\;\;\;\;\frac{x}{t \cdot \frac{1}{y - z} - \frac{z}{y - z}}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r542328 = x;
        double r542329 = y;
        double r542330 = z;
        double r542331 = r542329 - r542330;
        double r542332 = r542328 * r542331;
        double r542333 = t;
        double r542334 = r542333 - r542330;
        double r542335 = r542332 / r542334;
        return r542335;
}

double f(double x, double y, double z, double t) {
        double r542336 = z;
        double r542337 = -1.390173372602323e+33;
        bool r542338 = r542336 <= r542337;
        double r542339 = x;
        double r542340 = t;
        double r542341 = 1.0;
        double r542342 = y;
        double r542343 = r542342 - r542336;
        double r542344 = r542341 / r542343;
        double r542345 = r542340 * r542344;
        double r542346 = r542336 / r542343;
        double r542347 = r542345 - r542346;
        double r542348 = r542339 / r542347;
        double r542349 = -1.7069294686818465e-261;
        bool r542350 = r542336 <= r542349;
        double r542351 = r542340 - r542336;
        double r542352 = r542339 / r542351;
        double r542353 = r542343 * r542352;
        double r542354 = r542340 / r542343;
        double r542355 = r542354 - r542346;
        double r542356 = r542339 / r542355;
        double r542357 = r542350 ? r542353 : r542356;
        double r542358 = r542338 ? r542348 : r542357;
        return r542358;
}

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

Original11.3
Target2.0
Herbie2.4
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 3 regimes
  2. if z < -1.390173372602323e+33

    1. Initial program 18.4

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

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

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

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

    if -1.390173372602323e+33 < z < -1.7069294686818465e-261

    1. Initial program 5.1

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

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

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

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

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

      \[\leadsto \frac{x}{\color{blue}{\frac{1}{y - z} \cdot \left(t - z\right)}}\]
    10. Applied *-un-lft-identity3.3

      \[\leadsto \frac{\color{blue}{1 \cdot x}}{\frac{1}{y - z} \cdot \left(t - z\right)}\]
    11. Applied times-frac4.7

      \[\leadsto \color{blue}{\frac{1}{\frac{1}{y - z}} \cdot \frac{x}{t - z}}\]
    12. Simplified4.6

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

    if -1.7069294686818465e-261 < z

    1. Initial program 10.7

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.3901733726023231 \cdot 10^{33}:\\ \;\;\;\;\frac{x}{t \cdot \frac{1}{y - z} - \frac{z}{y - z}}\\ \mathbf{elif}\;z \le -1.7069294686818465 \cdot 10^{-261}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020045 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

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

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