Average Error: 11.4 → 2.4
Time: 3.2s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -9.8896762186455276 \cdot 10^{56}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \mathbf{elif}\;x \le 9.02230363154583301 \cdot 10^{-277}:\\ \;\;\;\;\frac{1}{\frac{t - z}{x \cdot \left(y - z\right)}}\\ \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}\;x \le -9.8896762186455276 \cdot 10^{56}:\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r764153 = x;
        double r764154 = y;
        double r764155 = z;
        double r764156 = r764154 - r764155;
        double r764157 = r764153 * r764156;
        double r764158 = t;
        double r764159 = r764158 - r764155;
        double r764160 = r764157 / r764159;
        return r764160;
}

double f(double x, double y, double z, double t) {
        double r764161 = x;
        double r764162 = -9.889676218645528e+56;
        bool r764163 = r764161 <= r764162;
        double r764164 = t;
        double r764165 = z;
        double r764166 = r764164 - r764165;
        double r764167 = r764161 / r764166;
        double r764168 = y;
        double r764169 = r764168 - r764165;
        double r764170 = r764167 * r764169;
        double r764171 = 9.022303631545833e-277;
        bool r764172 = r764161 <= r764171;
        double r764173 = 1.0;
        double r764174 = r764161 * r764169;
        double r764175 = r764166 / r764174;
        double r764176 = r764173 / r764175;
        double r764177 = r764166 / r764169;
        double r764178 = r764161 / r764177;
        double r764179 = r764172 ? r764176 : r764178;
        double r764180 = r764163 ? r764170 : r764179;
        return r764180;
}

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

Derivation

  1. Split input into 3 regimes
  2. if x < -9.889676218645528e+56

    1. Initial program 27.2

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

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
    4. Using strategy rm
    5. Applied associate-/r/3.0

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

    if -9.889676218645528e+56 < x < 9.022303631545833e-277

    1. Initial program 2.3

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

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

    if 9.022303631545833e-277 < x

    1. Initial program 11.9

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

      \[\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}\;x \le -9.8896762186455276 \cdot 10^{56}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \mathbf{elif}\;x \le 9.02230363154583301 \cdot 10^{-277}:\\ \;\;\;\;\frac{1}{\frac{t - z}{x \cdot \left(y - z\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \end{array}\]

Reproduce

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