Average Error: 11.8 → 2.5
Time: 13.6s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.038397466616709201424613632872647033599 \cdot 10^{-172}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{1}{y - z} \cdot z}\\ \mathbf{elif}\;z \le 2.705228326476905864845127294926591028976 \cdot 10^{-95}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{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}\;z \le -5.038397466616709201424613632872647033599 \cdot 10^{-172}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{1}{y - z} \cdot z}\\

\mathbf{elif}\;z \le 2.705228326476905864845127294926591028976 \cdot 10^{-95}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{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 r27043601 = x;
        double r27043602 = y;
        double r27043603 = z;
        double r27043604 = r27043602 - r27043603;
        double r27043605 = r27043601 * r27043604;
        double r27043606 = t;
        double r27043607 = r27043606 - r27043603;
        double r27043608 = r27043605 / r27043607;
        return r27043608;
}

double f(double x, double y, double z, double t) {
        double r27043609 = z;
        double r27043610 = -5.038397466616709e-172;
        bool r27043611 = r27043609 <= r27043610;
        double r27043612 = x;
        double r27043613 = t;
        double r27043614 = y;
        double r27043615 = r27043614 - r27043609;
        double r27043616 = r27043613 / r27043615;
        double r27043617 = 1.0;
        double r27043618 = r27043617 / r27043615;
        double r27043619 = r27043618 * r27043609;
        double r27043620 = r27043616 - r27043619;
        double r27043621 = r27043612 / r27043620;
        double r27043622 = 2.705228326476906e-95;
        bool r27043623 = r27043609 <= r27043622;
        double r27043624 = r27043613 - r27043609;
        double r27043625 = r27043612 / r27043624;
        double r27043626 = r27043615 * r27043625;
        double r27043627 = r27043615 / r27043624;
        double r27043628 = r27043612 * r27043627;
        double r27043629 = r27043623 ? r27043626 : r27043628;
        double r27043630 = r27043611 ? r27043621 : r27043629;
        return r27043630;
}

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.8
Target2.3
Herbie2.5
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 3 regimes
  2. if z < -5.038397466616709e-172

    1. Initial program 13.3

      \[\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}}}\]
    6. Using strategy rm
    7. Applied div-inv1.3

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

    if -5.038397466616709e-172 < z < 2.705228326476906e-95

    1. Initial program 5.6

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

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

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

      \[\leadsto \frac{x}{\frac{t}{y - z} - \color{blue}{z \cdot \frac{1}{y - z}}}\]
    8. Using strategy rm
    9. Applied un-div-inv6.1

      \[\leadsto \frac{x}{\frac{t}{y - z} - \color{blue}{\frac{z}{y - z}}}\]
    10. Applied sub-div6.1

      \[\leadsto \frac{x}{\color{blue}{\frac{t - z}{y - z}}}\]
    11. Applied associate-/r/6.7

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

    if 2.705228326476906e-95 < z

    1. Initial program 15.0

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.038397466616709201424613632872647033599 \cdot 10^{-172}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z} - \frac{1}{y - z} \cdot z}\\ \mathbf{elif}\;z \le 2.705228326476905864845127294926591028976 \cdot 10^{-95}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \end{array}\]

Reproduce

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