Average Error: 11.8 → 2.4
Time: 9.4s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.2131459224267867 \cdot 10^{-6} \lor \neg \left(z \le 1.363066750823439 \cdot 10^{-188}\right):\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{t - z}}{\frac{\frac{1}{y - z}}{x}}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le -1.2131459224267867 \cdot 10^{-6} \lor \neg \left(z \le 1.363066750823439 \cdot 10^{-188}\right):\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r862774 = x;
        double r862775 = y;
        double r862776 = z;
        double r862777 = r862775 - r862776;
        double r862778 = r862774 * r862777;
        double r862779 = t;
        double r862780 = r862779 - r862776;
        double r862781 = r862778 / r862780;
        return r862781;
}

double f(double x, double y, double z, double t) {
        double r862782 = z;
        double r862783 = -1.2131459224267867e-06;
        bool r862784 = r862782 <= r862783;
        double r862785 = 1.3630667508234389e-188;
        bool r862786 = r862782 <= r862785;
        double r862787 = !r862786;
        bool r862788 = r862784 || r862787;
        double r862789 = x;
        double r862790 = y;
        double r862791 = r862790 - r862782;
        double r862792 = t;
        double r862793 = r862792 - r862782;
        double r862794 = r862791 / r862793;
        double r862795 = r862789 * r862794;
        double r862796 = 1.0;
        double r862797 = r862796 / r862793;
        double r862798 = r862796 / r862791;
        double r862799 = r862798 / r862789;
        double r862800 = r862797 / r862799;
        double r862801 = r862788 ? r862795 : r862800;
        return r862801;
}

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

Derivation

  1. Split input into 2 regimes
  2. if z < -1.2131459224267867e-06 or 1.3630667508234389e-188 < z

    1. Initial program 14.7

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

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

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

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

    if -1.2131459224267867e-06 < z < 1.3630667508234389e-188

    1. Initial program 5.7

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{\frac{t - z}{y - z}}{x}}}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity5.8

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{t - z}{1} \cdot \frac{\frac{1}{y - z}}{x}}}\]
    10. Applied associate-/r*5.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.2131459224267867 \cdot 10^{-6} \lor \neg \left(z \le 1.363066750823439 \cdot 10^{-188}\right):\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{t - z}}{\frac{\frac{1}{y - z}}{x}}\\ \end{array}\]

Reproduce

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