Average Error: 11.7 → 2.3
Time: 12.7s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -3.521061957025556641796539972643784007943 \cdot 10^{-25}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;z \le -9.428482046988604409493750970835135222414 \cdot 10^{-240}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le -3.521061957025556641796539972643784007943 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r395779 = x;
        double r395780 = y;
        double r395781 = z;
        double r395782 = r395780 - r395781;
        double r395783 = r395779 * r395782;
        double r395784 = t;
        double r395785 = r395784 - r395781;
        double r395786 = r395783 / r395785;
        return r395786;
}

double f(double x, double y, double z, double t) {
        double r395787 = z;
        double r395788 = -3.5210619570255566e-25;
        bool r395789 = r395787 <= r395788;
        double r395790 = x;
        double r395791 = y;
        double r395792 = r395791 - r395787;
        double r395793 = t;
        double r395794 = r395793 - r395787;
        double r395795 = r395792 / r395794;
        double r395796 = r395790 * r395795;
        double r395797 = -9.428482046988604e-240;
        bool r395798 = r395787 <= r395797;
        double r395799 = r395792 * r395790;
        double r395800 = r395799 / r395794;
        double r395801 = r395794 / r395792;
        double r395802 = r395790 / r395801;
        double r395803 = r395798 ? r395800 : r395802;
        double r395804 = r395789 ? r395796 : r395803;
        return r395804;
}

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

Derivation

  1. Split input into 3 regimes
  2. if z < -3.5210619570255566e-25

    1. Initial program 16.1

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

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

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

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

    if -3.5210619570255566e-25 < z < -9.428482046988604e-240

    1. Initial program 5.7

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

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

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

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

      \[\leadsto x \cdot \color{blue}{{\left(\frac{y - z}{t - z}\right)}^{1}}\]
    8. Applied pow14.7

      \[\leadsto \color{blue}{{x}^{1}} \cdot {\left(\frac{y - z}{t - z}\right)}^{1}\]
    9. Applied pow-prod-down4.7

      \[\leadsto \color{blue}{{\left(x \cdot \frac{y - z}{t - z}\right)}^{1}}\]
    10. Simplified5.3

      \[\leadsto {\color{blue}{\left(\left(y - z\right) \cdot \frac{x}{t - z}\right)}}^{1}\]
    11. Using strategy rm
    12. Applied associate-*r/5.7

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

    if -9.428482046988604e-240 < z

    1. Initial program 11.2

      \[\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}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification2.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -3.521061957025556641796539972643784007943 \cdot 10^{-25}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;z \le -9.428482046988604409493750970835135222414 \cdot 10^{-240}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \end{array}\]

Reproduce

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