Average Error: 12.0 → 2.4
Time: 2.9s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -7.5411015698060821 \cdot 10^{-184}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;z \le 1.57991007729859192 \cdot 10^{-239}:\\ \;\;\;\;\left(x \cdot \left(y - z\right)\right) \cdot \frac{1}{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 -7.5411015698060821 \cdot 10^{-184}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r621848 = x;
        double r621849 = y;
        double r621850 = z;
        double r621851 = r621849 - r621850;
        double r621852 = r621848 * r621851;
        double r621853 = t;
        double r621854 = r621853 - r621850;
        double r621855 = r621852 / r621854;
        return r621855;
}

double f(double x, double y, double z, double t) {
        double r621856 = z;
        double r621857 = -7.541101569806082e-184;
        bool r621858 = r621856 <= r621857;
        double r621859 = x;
        double r621860 = y;
        double r621861 = r621860 - r621856;
        double r621862 = t;
        double r621863 = r621862 - r621856;
        double r621864 = r621861 / r621863;
        double r621865 = r621859 * r621864;
        double r621866 = 1.579910077298592e-239;
        bool r621867 = r621856 <= r621866;
        double r621868 = r621859 * r621861;
        double r621869 = 1.0;
        double r621870 = r621869 / r621863;
        double r621871 = r621868 * r621870;
        double r621872 = r621863 / r621861;
        double r621873 = r621859 / r621872;
        double r621874 = r621867 ? r621871 : r621873;
        double r621875 = r621858 ? r621865 : r621874;
        return r621875;
}

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

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

Derivation

  1. Split input into 3 regimes
  2. if z < -7.541101569806082e-184

    1. Initial program 12.5

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

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

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

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

    if -7.541101569806082e-184 < z < 1.579910077298592e-239

    1. Initial program 7.2

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied div-inv7.3

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

    if 1.579910077298592e-239 < z

    1. Initial program 13.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -7.5411015698060821 \cdot 10^{-184}:\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{elif}\;z \le 1.57991007729859192 \cdot 10^{-239}:\\ \;\;\;\;\left(x \cdot \left(y - z\right)\right) \cdot \frac{1}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \end{array}\]

Reproduce

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