Average Error: 11.3 → 1.5
Time: 4.1s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} = -inf.0:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -8.18841900648959773 \cdot 10^{-214}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y - z\right) \cdot \frac{1}{t - z}\right)\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} = -inf.0:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\

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

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

\end{array}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (x * ((double) (y - z)))) / ((double) (t - z))));
}
double code(double x, double y, double z, double t) {
	double VAR;
	if ((((double) (((double) (x * ((double) (y - z)))) / ((double) (t - z)))) <= -inf.0)) {
		VAR = ((double) (((double) (y - z)) * ((double) (x / ((double) (t - z))))));
	} else {
		double VAR_1;
		if ((((double) (((double) (x * ((double) (y - z)))) / ((double) (t - z)))) <= -8.188419006489598e-214)) {
			VAR_1 = ((double) (((double) (x * ((double) (y - z)))) / ((double) (t - z))));
		} else {
			VAR_1 = ((double) (x * ((double) (((double) (y - z)) * ((double) (1.0 / ((double) (t - z))))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

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.3
Target2.2
Herbie1.5
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* x (- y z)) (- t z)) < -inf.0

    1. Initial program 64.0

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Simplified0.1

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt1.3

      \[\leadsto x \cdot \frac{y - z}{\color{blue}{\left(\sqrt[3]{t - z} \cdot \sqrt[3]{t - z}\right) \cdot \sqrt[3]{t - z}}}\]
    5. Applied *-un-lft-identity1.3

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

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{t - z} \cdot \sqrt[3]{t - z}} \cdot \frac{y - z}{\sqrt[3]{t - z}}\right)}\]
    7. Applied associate-*r*1.3

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

      \[\leadsto \color{blue}{\frac{x}{\sqrt[3]{t - z} \cdot \sqrt[3]{t - z}}} \cdot \frac{y - z}{\sqrt[3]{t - z}}\]
    9. Using strategy rm
    10. Applied pow11.3

      \[\leadsto \frac{x}{\sqrt[3]{t - z} \cdot \sqrt[3]{t - z}} \cdot \color{blue}{{\left(\frac{y - z}{\sqrt[3]{t - z}}\right)}^{1}}\]
    11. Applied pow11.3

      \[\leadsto \color{blue}{{\left(\frac{x}{\sqrt[3]{t - z} \cdot \sqrt[3]{t - z}}\right)}^{1}} \cdot {\left(\frac{y - z}{\sqrt[3]{t - z}}\right)}^{1}\]
    12. Applied pow-prod-down1.3

      \[\leadsto \color{blue}{{\left(\frac{x}{\sqrt[3]{t - z} \cdot \sqrt[3]{t - z}} \cdot \frac{y - z}{\sqrt[3]{t - z}}\right)}^{1}}\]
    13. Simplified0.2

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

    if -inf.0 < (/ (* x (- y z)) (- t z)) < -8.18841900648959773e-214

    1. Initial program 0.3

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

    if -8.18841900648959773e-214 < (/ (* x (- y z)) (- t z))

    1. Initial program 10.2

      \[\frac{x \cdot \left(y - z\right)}{t - z}\]
    2. Simplified2.1

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}}\]
    3. Using strategy rm
    4. Applied div-inv2.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} = -inf.0:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \le -8.18841900648959773 \cdot 10^{-214}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y - z\right) \cdot \frac{1}{t - z}\right)\\ \end{array}\]

Reproduce

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