Average Error: 11.9 → 2.0
Time: 4.0s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \le -8.05105609781592315 \cdot 10^{-223} \lor \neg \left(z \le 1.34650257932233616 \cdot 10^{-105}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \le -8.05105609781592315 \cdot 10^{-223} \lor \neg \left(z \le 1.34650257932233616 \cdot 10^{-105}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r626244 = x;
        double r626245 = y;
        double r626246 = z;
        double r626247 = r626245 - r626246;
        double r626248 = r626244 * r626247;
        double r626249 = t;
        double r626250 = r626249 - r626246;
        double r626251 = r626248 / r626250;
        return r626251;
}

double f(double x, double y, double z, double t) {
        double r626252 = z;
        double r626253 = -8.051056097815923e-223;
        bool r626254 = r626252 <= r626253;
        double r626255 = 1.3465025793223362e-105;
        bool r626256 = r626252 <= r626255;
        double r626257 = !r626256;
        bool r626258 = r626254 || r626257;
        double r626259 = x;
        double r626260 = t;
        double r626261 = r626260 - r626252;
        double r626262 = y;
        double r626263 = r626262 - r626252;
        double r626264 = r626261 / r626263;
        double r626265 = r626259 / r626264;
        double r626266 = r626259 * r626263;
        double r626267 = r626266 / r626261;
        double r626268 = r626258 ? r626265 : r626267;
        return r626268;
}

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

Derivation

  1. Split input into 2 regimes
  2. if z < -8.051056097815923e-223 or 1.3465025793223362e-105 < z

    1. Initial program 13.8

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

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

    if -8.051056097815923e-223 < z < 1.3465025793223362e-105

    1. Initial program 5.1

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification2.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -8.05105609781592315 \cdot 10^{-223} \lor \neg \left(z \le 1.34650257932233616 \cdot 10^{-105}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \end{array}\]

Reproduce

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