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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r648577 = x;
        double r648578 = y;
        double r648579 = z;
        double r648580 = r648578 - r648579;
        double r648581 = r648577 * r648580;
        double r648582 = t;
        double r648583 = r648582 - r648579;
        double r648584 = r648581 / r648583;
        return r648584;
}

double f(double x, double y, double z, double t) {
        double r648585 = z;
        double r648586 = -1.390173372602323e+33;
        bool r648587 = r648585 <= r648586;
        double r648588 = -1.7069294686818465e-261;
        bool r648589 = r648585 <= r648588;
        double r648590 = !r648589;
        bool r648591 = r648587 || r648590;
        double r648592 = x;
        double r648593 = t;
        double r648594 = y;
        double r648595 = r648594 - r648585;
        double r648596 = r648593 / r648595;
        double r648597 = r648585 / r648595;
        double r648598 = r648596 - r648597;
        double r648599 = r648592 / r648598;
        double r648600 = r648593 - r648585;
        double r648601 = r648592 / r648600;
        double r648602 = r648595 * r648601;
        double r648603 = r648591 ? r648599 : r648602;
        return r648603;
}

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 2 regimes
  2. if z < -1.390173372602323e+33 or -1.7069294686818465e-261 < z

    1. Initial program 13.1

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

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

      \[\leadsto \frac{x}{\color{blue}{\frac{t}{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}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification2.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.3901733726023231 \cdot 10^{33} \lor \neg \left(z \le -1.7069294686818465 \cdot 10^{-261}\right):\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - 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)))