Average Error: 11.4 → 2.1
Time: 2.9s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;z \leq -1.933835084880591 \cdot 10^{-138} \lor \neg \left(z \leq 2.7822942298388567 \cdot 10^{-251}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\sqrt[3]{t - z} \cdot \sqrt[3]{t - z}} \cdot \frac{y - z}{\sqrt[3]{t - z}}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;z \leq -1.933835084880591 \cdot 10^{-138} \lor \neg \left(z \leq 2.7822942298388567 \cdot 10^{-251}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\sqrt[3]{t - z} \cdot \sqrt[3]{t - z}} \cdot \frac{y - z}{\sqrt[3]{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 (<= z -1.933835084880591e-138) (not (<= z 2.7822942298388567e-251)))
   (/ x (/ (- t z) (- y z)))
   (* (/ x (* (cbrt (- t z)) (cbrt (- t z)))) (/ (- y z) (cbrt (- 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 ((z <= -1.933835084880591e-138) || !(z <= 2.7822942298388567e-251)) {
		tmp = x / ((t - z) / (y - z));
	} else {
		tmp = (x / (cbrt(t - z) * cbrt(t - z))) * ((y - z) / cbrt(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.4
Target2.3
Herbie2.1
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -1.93383508488059105e-138 or 2.7822942298388567e-251 < z

    1. Initial program 12.5

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

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

    if -1.93383508488059105e-138 < z < 2.7822942298388567e-251

    1. Initial program 6.0

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt_binary646.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.933835084880591 \cdot 10^{-138} \lor \neg \left(z \leq 2.7822942298388567 \cdot 10^{-251}\right):\\ \;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\sqrt[3]{t - z} \cdot \sqrt[3]{t - z}} \cdot \frac{y - z}{\sqrt[3]{t - z}}\\ \end{array}\]

Reproduce

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