Average Error: 11.5 → 2.0
Time: 3.9s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;x \leq -12322005424938166 \lor \neg \left(x \leq 6.066042882022291 \cdot 10^{-266}\right):\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y - z\right)\right) \cdot \frac{1}{t - z}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;x \leq -12322005424938166 \lor \neg \left(x \leq 6.066042882022291 \cdot 10^{-266}\right):\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\

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

\end{array}
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -12322005424938166.0) (not (<= x 6.066042882022291e-266)))
   (* x (/ (- y z) (- t z)))
   (* (* x (- y z)) (/ 1.0 (- t z)))))
double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -12322005424938166.0) || !(x <= 6.066042882022291e-266)) {
		tmp = x * ((y - z) / (t - z));
	} else {
		tmp = (x * (y - z)) * (1.0 / (t - z));
	}
	return tmp;
}

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

Derivation

  1. Split input into 2 regimes
  2. if x < -12322005424938166 or 6.0660428820222911e-266 < x

    1. Initial program 16.0

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

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

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

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

    if -12322005424938166 < x < 6.0660428820222911e-266

    1. Initial program 2.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -12322005424938166 \lor \neg \left(x \leq 6.066042882022291 \cdot 10^{-266}\right):\\ \;\;\;\;x \cdot \frac{y - z}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y - z\right)\right) \cdot \frac{1}{t - z}\\ \end{array}\]

Reproduce

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