Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3

Percentage Accurate: 84.2% → 97.2%
Time: 10.1s
Alternatives: 10
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{x \cdot \left(y - z\right)}{t - z} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
def code(x, y, z, t):
	return (x * (y - z)) / (t - z)
function code(x, y, z, t)
	return Float64(Float64(x * Float64(y - z)) / Float64(t - z))
end
function tmp = code(x, y, z, t)
	tmp = (x * (y - z)) / (t - z);
end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 10 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 84.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot \left(y - z\right)}{t - z} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x * (y - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
def code(x, y, z, t):
	return (x * (y - z)) / (t - z)
function code(x, y, z, t)
	return Float64(Float64(x * Float64(y - z)) / Float64(t - z))
end
function tmp = code(x, y, z, t)
	tmp = (x * (y - z)) / (t - z);
end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}

Alternative 1: 97.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x}{\frac{t - z}{y - z}} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
	return x / ((t - z) / (y - z));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
	return x / ((t - z) / (y - z));
}
def code(x, y, z, t):
	return x / ((t - z) / (y - z))
function code(x, y, z, t)
	return Float64(x / Float64(Float64(t - z) / Float64(y - z)))
end
function tmp = code(x, y, z, t)
	tmp = x / ((t - z) / (y - z));
end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
Derivation
  1. Initial program 80.4%

    \[\frac{x \cdot \left(y - z\right)}{t - z} \]
  2. Step-by-step derivation
    1. associate-/l*97.9%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. clear-num97.8%

      \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{t - z}{y - z}}} \]
    2. un-div-inv98.3%

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
  6. Applied egg-rr98.3%

    \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
  7. Final simplification98.3%

    \[\leadsto \frac{x}{\frac{t - z}{y - z}} \]
  8. Add Preprocessing

Alternative 2: 70.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{if}\;z \leq -1.06 \cdot 10^{-9}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-73}:\\ \;\;\;\;-\frac{x \cdot z}{t}\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-89}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-136}:\\ \;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;z \leq 6.9 \cdot 10^{-54}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ y z)))))
   (if (<= z -1.06e-9)
     t_1
     (if (<= z -1.95e-73)
       (- (/ (* x z) t))
       (if (<= z -3.4e-89)
         (* x (/ y t))
         (if (<= z -5.8e-136)
           (/ (* x (- y)) z)
           (if (<= z 6.9e-54) (/ x (/ t y)) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / z));
	double tmp;
	if (z <= -1.06e-9) {
		tmp = t_1;
	} else if (z <= -1.95e-73) {
		tmp = -((x * z) / t);
	} else if (z <= -3.4e-89) {
		tmp = x * (y / t);
	} else if (z <= -5.8e-136) {
		tmp = (x * -y) / z;
	} else if (z <= 6.9e-54) {
		tmp = x / (t / y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - (y / z))
    if (z <= (-1.06d-9)) then
        tmp = t_1
    else if (z <= (-1.95d-73)) then
        tmp = -((x * z) / t)
    else if (z <= (-3.4d-89)) then
        tmp = x * (y / t)
    else if (z <= (-5.8d-136)) then
        tmp = (x * -y) / z
    else if (z <= 6.9d-54) then
        tmp = x / (t / y)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / z));
	double tmp;
	if (z <= -1.06e-9) {
		tmp = t_1;
	} else if (z <= -1.95e-73) {
		tmp = -((x * z) / t);
	} else if (z <= -3.4e-89) {
		tmp = x * (y / t);
	} else if (z <= -5.8e-136) {
		tmp = (x * -y) / z;
	} else if (z <= 6.9e-54) {
		tmp = x / (t / y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - (y / z))
	tmp = 0
	if z <= -1.06e-9:
		tmp = t_1
	elif z <= -1.95e-73:
		tmp = -((x * z) / t)
	elif z <= -3.4e-89:
		tmp = x * (y / t)
	elif z <= -5.8e-136:
		tmp = (x * -y) / z
	elif z <= 6.9e-54:
		tmp = x / (t / y)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - Float64(y / z)))
	tmp = 0.0
	if (z <= -1.06e-9)
		tmp = t_1;
	elseif (z <= -1.95e-73)
		tmp = Float64(-Float64(Float64(x * z) / t));
	elseif (z <= -3.4e-89)
		tmp = Float64(x * Float64(y / t));
	elseif (z <= -5.8e-136)
		tmp = Float64(Float64(x * Float64(-y)) / z);
	elseif (z <= 6.9e-54)
		tmp = Float64(x / Float64(t / y));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - (y / z));
	tmp = 0.0;
	if (z <= -1.06e-9)
		tmp = t_1;
	elseif (z <= -1.95e-73)
		tmp = -((x * z) / t);
	elseif (z <= -3.4e-89)
		tmp = x * (y / t);
	elseif (z <= -5.8e-136)
		tmp = (x * -y) / z;
	elseif (z <= 6.9e-54)
		tmp = x / (t / y);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.06e-9], t$95$1, If[LessEqual[z, -1.95e-73], (-N[(N[(x * z), $MachinePrecision] / t), $MachinePrecision]), If[LessEqual[z, -3.4e-89], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.8e-136], N[(N[(x * (-y)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 6.9e-54], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -1.06 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-73}:\\
\;\;\;\;-\frac{x \cdot z}{t}\\

\mathbf{elif}\;z \leq -3.4 \cdot 10^{-89}:\\
\;\;\;\;x \cdot \frac{y}{t}\\

\mathbf{elif}\;z \leq -5.8 \cdot 10^{-136}:\\
\;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\

\mathbf{elif}\;z \leq 6.9 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.0600000000000001e-9 or 6.89999999999999969e-54 < z

    1. Initial program 72.3%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*99.2%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified99.2%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 54.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg54.1%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{z}} \]
      2. associate-/l*73.2%

        \[\leadsto -\color{blue}{x \cdot \frac{y - z}{z}} \]
      3. distribute-rgt-neg-in73.2%

        \[\leadsto \color{blue}{x \cdot \left(-\frac{y - z}{z}\right)} \]
      4. distribute-frac-neg73.2%

        \[\leadsto x \cdot \color{blue}{\frac{-\left(y - z\right)}{z}} \]
      5. neg-sub073.2%

        \[\leadsto x \cdot \frac{\color{blue}{0 - \left(y - z\right)}}{z} \]
      6. associate--r-73.2%

        \[\leadsto x \cdot \frac{\color{blue}{\left(0 - y\right) + z}}{z} \]
      7. neg-sub073.2%

        \[\leadsto x \cdot \frac{\color{blue}{\left(-y\right)} + z}{z} \]
      8. +-commutative73.2%

        \[\leadsto x \cdot \frac{\color{blue}{z + \left(-y\right)}}{z} \]
      9. sub-neg73.2%

        \[\leadsto x \cdot \frac{\color{blue}{z - y}}{z} \]
      10. div-sub73.2%

        \[\leadsto x \cdot \color{blue}{\left(\frac{z}{z} - \frac{y}{z}\right)} \]
      11. *-inverses73.2%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{y}{z}\right) \]
    7. Simplified73.2%

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

    if -1.0600000000000001e-9 < z < -1.94999999999999991e-73

    1. Initial program 99.8%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{t - z}{y - z}}} \]
      2. un-div-inv100.0%

        \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    7. Taylor expanded in y around 0 75.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{t - z}} \]
    8. Step-by-step derivation
      1. associate-*r/75.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot z\right)}{t - z}} \]
      2. mul-1-neg75.5%

        \[\leadsto \frac{\color{blue}{-x \cdot z}}{t - z} \]
      3. distribute-rgt-neg-out75.5%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-z\right)}}{t - z} \]
      4. associate-*l/75.3%

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(-z\right)} \]
      5. *-commutative75.3%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{x}{t - z}} \]
      6. distribute-lft-neg-out75.3%

        \[\leadsto \color{blue}{-z \cdot \frac{x}{t - z}} \]
      7. distribute-rgt-neg-in75.3%

        \[\leadsto \color{blue}{z \cdot \left(-\frac{x}{t - z}\right)} \]
    9. Simplified75.3%

      \[\leadsto \color{blue}{z \cdot \left(-\frac{x}{t - z}\right)} \]
    10. Taylor expanded in z around 0 72.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{t}} \]
    11. Step-by-step derivation
      1. associate-*r/72.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot z\right)}{t}} \]
      2. mul-1-neg72.3%

        \[\leadsto \frac{\color{blue}{-x \cdot z}}{t} \]
      3. distribute-lft-neg-out72.3%

        \[\leadsto \frac{\color{blue}{\left(-x\right) \cdot z}}{t} \]
      4. *-commutative72.3%

        \[\leadsto \frac{\color{blue}{z \cdot \left(-x\right)}}{t} \]
    12. Simplified72.3%

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

    if -1.94999999999999991e-73 < z < -3.4e-89

    1. Initial program 61.8%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*99.7%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 41.9%

      \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
    6. Step-by-step derivation
      1. associate-/l*79.8%

        \[\leadsto \color{blue}{x \cdot \frac{y}{t}} \]
    7. Simplified79.8%

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

    if -3.4e-89 < z < -5.79999999999999989e-136

    1. Initial program 99.7%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*62.0%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified62.0%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 56.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg56.6%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{z}} \]
      2. associate-/l*5.3%

        \[\leadsto -\color{blue}{x \cdot \frac{y - z}{z}} \]
      3. distribute-rgt-neg-in5.3%

        \[\leadsto \color{blue}{x \cdot \left(-\frac{y - z}{z}\right)} \]
      4. distribute-frac-neg5.3%

        \[\leadsto x \cdot \color{blue}{\frac{-\left(y - z\right)}{z}} \]
      5. neg-sub05.3%

        \[\leadsto x \cdot \frac{\color{blue}{0 - \left(y - z\right)}}{z} \]
      6. associate--r-5.3%

        \[\leadsto x \cdot \frac{\color{blue}{\left(0 - y\right) + z}}{z} \]
      7. neg-sub05.3%

        \[\leadsto x \cdot \frac{\color{blue}{\left(-y\right)} + z}{z} \]
      8. +-commutative5.3%

        \[\leadsto x \cdot \frac{\color{blue}{z + \left(-y\right)}}{z} \]
      9. sub-neg5.3%

        \[\leadsto x \cdot \frac{\color{blue}{z - y}}{z} \]
      10. div-sub5.3%

        \[\leadsto x \cdot \color{blue}{\left(\frac{z}{z} - \frac{y}{z}\right)} \]
      11. *-inverses5.3%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{y}{z}\right) \]
    7. Simplified5.3%

      \[\leadsto \color{blue}{x \cdot \left(1 - \frac{y}{z}\right)} \]
    8. Taylor expanded in y around inf 75.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{z}} \]
    9. Step-by-step derivation
      1. associate-*r/75.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot y\right)}{z}} \]
      2. mul-1-neg75.7%

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{z} \]
      3. distribute-rgt-neg-out75.7%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-y\right)}}{z} \]
    10. Simplified75.7%

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

    if -5.79999999999999989e-136 < z < 6.89999999999999969e-54

    1. Initial program 91.1%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*97.7%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified97.7%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num97.5%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{t - z}{y - z}}} \]
      2. un-div-inv97.7%

        \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    6. Applied egg-rr97.7%

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    7. Taylor expanded in z around 0 78.8%

      \[\leadsto \frac{x}{\color{blue}{\frac{t}{y}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification75.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.06 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-73}:\\ \;\;\;\;-\frac{x \cdot z}{t}\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-89}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-136}:\\ \;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;z \leq 6.9 \cdot 10^{-54}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 75.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+39} \lor \neg \left(z \leq -1.35 \cdot 10^{+14}\right) \land \left(z \leq -2.5 \cdot 10^{-11} \lor \neg \left(z \leq 1.66 \cdot 10^{+25}\right)\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -7.5e+39)
         (and (not (<= z -1.35e+14))
              (or (<= z -2.5e-11) (not (<= z 1.66e+25)))))
   (* x (- 1.0 (/ y z)))
   (* x (/ (- y z) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -7.5e+39) || (!(z <= -1.35e+14) && ((z <= -2.5e-11) || !(z <= 1.66e+25)))) {
		tmp = x * (1.0 - (y / z));
	} else {
		tmp = x * ((y - z) / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-7.5d+39)) .or. (.not. (z <= (-1.35d+14))) .and. (z <= (-2.5d-11)) .or. (.not. (z <= 1.66d+25))) then
        tmp = x * (1.0d0 - (y / z))
    else
        tmp = x * ((y - z) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -7.5e+39) || (!(z <= -1.35e+14) && ((z <= -2.5e-11) || !(z <= 1.66e+25)))) {
		tmp = x * (1.0 - (y / z));
	} else {
		tmp = x * ((y - z) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -7.5e+39) or (not (z <= -1.35e+14) and ((z <= -2.5e-11) or not (z <= 1.66e+25))):
		tmp = x * (1.0 - (y / z))
	else:
		tmp = x * ((y - z) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -7.5e+39) || (!(z <= -1.35e+14) && ((z <= -2.5e-11) || !(z <= 1.66e+25))))
		tmp = Float64(x * Float64(1.0 - Float64(y / z)));
	else
		tmp = Float64(x * Float64(Float64(y - z) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -7.5e+39) || (~((z <= -1.35e+14)) && ((z <= -2.5e-11) || ~((z <= 1.66e+25)))))
		tmp = x * (1.0 - (y / z));
	else
		tmp = x * ((y - z) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.5e+39], And[N[Not[LessEqual[z, -1.35e+14]], $MachinePrecision], Or[LessEqual[z, -2.5e-11], N[Not[LessEqual[z, 1.66e+25]], $MachinePrecision]]]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+39} \lor \neg \left(z \leq -1.35 \cdot 10^{+14}\right) \land \left(z \leq -2.5 \cdot 10^{-11} \lor \neg \left(z \leq 1.66 \cdot 10^{+25}\right)\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.5000000000000005e39 or -1.35e14 < z < -2.50000000000000009e-11 or 1.6600000000000001e25 < z

    1. Initial program 69.1%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 56.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg56.3%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{z}} \]
      2. associate-/l*79.8%

        \[\leadsto -\color{blue}{x \cdot \frac{y - z}{z}} \]
      3. distribute-rgt-neg-in79.8%

        \[\leadsto \color{blue}{x \cdot \left(-\frac{y - z}{z}\right)} \]
      4. distribute-frac-neg79.8%

        \[\leadsto x \cdot \color{blue}{\frac{-\left(y - z\right)}{z}} \]
      5. neg-sub079.8%

        \[\leadsto x \cdot \frac{\color{blue}{0 - \left(y - z\right)}}{z} \]
      6. associate--r-79.8%

        \[\leadsto x \cdot \frac{\color{blue}{\left(0 - y\right) + z}}{z} \]
      7. neg-sub079.8%

        \[\leadsto x \cdot \frac{\color{blue}{\left(-y\right)} + z}{z} \]
      8. +-commutative79.8%

        \[\leadsto x \cdot \frac{\color{blue}{z + \left(-y\right)}}{z} \]
      9. sub-neg79.8%

        \[\leadsto x \cdot \frac{\color{blue}{z - y}}{z} \]
      10. div-sub79.8%

        \[\leadsto x \cdot \color{blue}{\left(\frac{z}{z} - \frac{y}{z}\right)} \]
      11. *-inverses79.8%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{y}{z}\right) \]
    7. Simplified79.8%

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

    if -7.5000000000000005e39 < z < -1.35e14 or -2.50000000000000009e-11 < z < 1.6600000000000001e25

    1. Initial program 90.3%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*96.3%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified96.3%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 76.4%

      \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t}} \]
    6. Step-by-step derivation
      1. associate-/l*84.4%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t}} \]
    7. Simplified84.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+39} \lor \neg \left(z \leq -1.35 \cdot 10^{+14}\right) \land \left(z \leq -2.5 \cdot 10^{-11} \lor \neg \left(z \leq 1.66 \cdot 10^{+25}\right)\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y - z}{t}\\ t_2 := x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{if}\;z \leq -5.5 \cdot 10^{+39}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-9}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 2.06 \cdot 10^{+18}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \frac{y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ (- y z) t))) (t_2 (* x (- 1.0 (/ y z)))))
   (if (<= z -5.5e+39)
     t_2
     (if (<= z -9.5e+16)
       t_1
       (if (<= z -1.6e-9) t_2 (if (<= z 2.06e+18) t_1 (- x (* x (/ y z)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y - z) / t);
	double t_2 = x * (1.0 - (y / z));
	double tmp;
	if (z <= -5.5e+39) {
		tmp = t_2;
	} else if (z <= -9.5e+16) {
		tmp = t_1;
	} else if (z <= -1.6e-9) {
		tmp = t_2;
	} else if (z <= 2.06e+18) {
		tmp = t_1;
	} else {
		tmp = x - (x * (y / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * ((y - z) / t)
    t_2 = x * (1.0d0 - (y / z))
    if (z <= (-5.5d+39)) then
        tmp = t_2
    else if (z <= (-9.5d+16)) then
        tmp = t_1
    else if (z <= (-1.6d-9)) then
        tmp = t_2
    else if (z <= 2.06d+18) then
        tmp = t_1
    else
        tmp = x - (x * (y / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * ((y - z) / t);
	double t_2 = x * (1.0 - (y / z));
	double tmp;
	if (z <= -5.5e+39) {
		tmp = t_2;
	} else if (z <= -9.5e+16) {
		tmp = t_1;
	} else if (z <= -1.6e-9) {
		tmp = t_2;
	} else if (z <= 2.06e+18) {
		tmp = t_1;
	} else {
		tmp = x - (x * (y / z));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y - z) / t)
	t_2 = x * (1.0 - (y / z))
	tmp = 0
	if z <= -5.5e+39:
		tmp = t_2
	elif z <= -9.5e+16:
		tmp = t_1
	elif z <= -1.6e-9:
		tmp = t_2
	elif z <= 2.06e+18:
		tmp = t_1
	else:
		tmp = x - (x * (y / z))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y - z) / t))
	t_2 = Float64(x * Float64(1.0 - Float64(y / z)))
	tmp = 0.0
	if (z <= -5.5e+39)
		tmp = t_2;
	elseif (z <= -9.5e+16)
		tmp = t_1;
	elseif (z <= -1.6e-9)
		tmp = t_2;
	elseif (z <= 2.06e+18)
		tmp = t_1;
	else
		tmp = Float64(x - Float64(x * Float64(y / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y - z) / t);
	t_2 = x * (1.0 - (y / z));
	tmp = 0.0;
	if (z <= -5.5e+39)
		tmp = t_2;
	elseif (z <= -9.5e+16)
		tmp = t_1;
	elseif (z <= -1.6e-9)
		tmp = t_2;
	elseif (z <= 2.06e+18)
		tmp = t_1;
	else
		tmp = x - (x * (y / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+39], t$95$2, If[LessEqual[z, -9.5e+16], t$95$1, If[LessEqual[z, -1.6e-9], t$95$2, If[LessEqual[z, 2.06e+18], t$95$1, N[(x - N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \frac{y - z}{t}\\
t_2 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+39}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -9.5 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.6 \cdot 10^{-9}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 2.06 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.4999999999999997e39 or -9.5e16 < z < -1.60000000000000006e-9

    1. Initial program 77.3%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 62.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg62.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{z}} \]
      2. associate-/l*80.1%

        \[\leadsto -\color{blue}{x \cdot \frac{y - z}{z}} \]
      3. distribute-rgt-neg-in80.1%

        \[\leadsto \color{blue}{x \cdot \left(-\frac{y - z}{z}\right)} \]
      4. distribute-frac-neg80.1%

        \[\leadsto x \cdot \color{blue}{\frac{-\left(y - z\right)}{z}} \]
      5. neg-sub080.1%

        \[\leadsto x \cdot \frac{\color{blue}{0 - \left(y - z\right)}}{z} \]
      6. associate--r-80.1%

        \[\leadsto x \cdot \frac{\color{blue}{\left(0 - y\right) + z}}{z} \]
      7. neg-sub080.1%

        \[\leadsto x \cdot \frac{\color{blue}{\left(-y\right)} + z}{z} \]
      8. +-commutative80.1%

        \[\leadsto x \cdot \frac{\color{blue}{z + \left(-y\right)}}{z} \]
      9. sub-neg80.1%

        \[\leadsto x \cdot \frac{\color{blue}{z - y}}{z} \]
      10. div-sub80.1%

        \[\leadsto x \cdot \color{blue}{\left(\frac{z}{z} - \frac{y}{z}\right)} \]
      11. *-inverses80.1%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{y}{z}\right) \]
    7. Simplified80.1%

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

    if -5.4999999999999997e39 < z < -9.5e16 or -1.60000000000000006e-9 < z < 2.06e18

    1. Initial program 90.3%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*96.3%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified96.3%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 76.4%

      \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t}} \]
    6. Step-by-step derivation
      1. associate-/l*84.4%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t}} \]
    7. Simplified84.4%

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

    if 2.06e18 < z

    1. Initial program 60.1%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 70.3%

      \[\leadsto \color{blue}{\left(x + -1 \cdot \frac{x \cdot y}{z}\right) - -1 \cdot \frac{t \cdot x}{z}} \]
    6. Step-by-step derivation
      1. associate--l+70.3%

        \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
      2. distribute-lft-out--70.3%

        \[\leadsto x + \color{blue}{-1 \cdot \left(\frac{x \cdot y}{z} - \frac{t \cdot x}{z}\right)} \]
      3. div-sub70.3%

        \[\leadsto x + -1 \cdot \color{blue}{\frac{x \cdot y - t \cdot x}{z}} \]
      4. mul-1-neg70.3%

        \[\leadsto x + \color{blue}{\left(-\frac{x \cdot y - t \cdot x}{z}\right)} \]
      5. unsub-neg70.3%

        \[\leadsto \color{blue}{x - \frac{x \cdot y - t \cdot x}{z}} \]
      6. *-commutative70.3%

        \[\leadsto x - \frac{x \cdot y - \color{blue}{x \cdot t}}{z} \]
      7. distribute-lft-out--70.5%

        \[\leadsto x - \frac{\color{blue}{x \cdot \left(y - t\right)}}{z} \]
    7. Simplified70.5%

      \[\leadsto \color{blue}{x - \frac{x \cdot \left(y - t\right)}{z}} \]
    8. Taylor expanded in y around inf 74.3%

      \[\leadsto x - \color{blue}{\frac{x \cdot y}{z}} \]
    9. Step-by-step derivation
      1. associate-/l*79.6%

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{z}} \]
    10. Simplified79.6%

      \[\leadsto x - \color{blue}{x \cdot \frac{y}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{+16}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 2.06 \cdot 10^{+18}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 75.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{\frac{t}{y - z}}\\ t_2 := x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{if}\;z \leq -8.8 \cdot 10^{+39}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -45000000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-9}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \frac{y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (/ t (- y z)))) (t_2 (* x (- 1.0 (/ y z)))))
   (if (<= z -8.8e+39)
     t_2
     (if (<= z -45000000000000.0)
       t_1
       (if (<= z -5e-9) t_2 (if (<= z 2e+22) t_1 (- x (* x (/ y z)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x / (t / (y - z));
	double t_2 = x * (1.0 - (y / z));
	double tmp;
	if (z <= -8.8e+39) {
		tmp = t_2;
	} else if (z <= -45000000000000.0) {
		tmp = t_1;
	} else if (z <= -5e-9) {
		tmp = t_2;
	} else if (z <= 2e+22) {
		tmp = t_1;
	} else {
		tmp = x - (x * (y / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x / (t / (y - z))
    t_2 = x * (1.0d0 - (y / z))
    if (z <= (-8.8d+39)) then
        tmp = t_2
    else if (z <= (-45000000000000.0d0)) then
        tmp = t_1
    else if (z <= (-5d-9)) then
        tmp = t_2
    else if (z <= 2d+22) then
        tmp = t_1
    else
        tmp = x - (x * (y / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (t / (y - z));
	double t_2 = x * (1.0 - (y / z));
	double tmp;
	if (z <= -8.8e+39) {
		tmp = t_2;
	} else if (z <= -45000000000000.0) {
		tmp = t_1;
	} else if (z <= -5e-9) {
		tmp = t_2;
	} else if (z <= 2e+22) {
		tmp = t_1;
	} else {
		tmp = x - (x * (y / z));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x / (t / (y - z))
	t_2 = x * (1.0 - (y / z))
	tmp = 0
	if z <= -8.8e+39:
		tmp = t_2
	elif z <= -45000000000000.0:
		tmp = t_1
	elif z <= -5e-9:
		tmp = t_2
	elif z <= 2e+22:
		tmp = t_1
	else:
		tmp = x - (x * (y / z))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x / Float64(t / Float64(y - z)))
	t_2 = Float64(x * Float64(1.0 - Float64(y / z)))
	tmp = 0.0
	if (z <= -8.8e+39)
		tmp = t_2;
	elseif (z <= -45000000000000.0)
		tmp = t_1;
	elseif (z <= -5e-9)
		tmp = t_2;
	elseif (z <= 2e+22)
		tmp = t_1;
	else
		tmp = Float64(x - Float64(x * Float64(y / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x / (t / (y - z));
	t_2 = x * (1.0 - (y / z));
	tmp = 0.0;
	if (z <= -8.8e+39)
		tmp = t_2;
	elseif (z <= -45000000000000.0)
		tmp = t_1;
	elseif (z <= -5e-9)
		tmp = t_2;
	elseif (z <= 2e+22)
		tmp = t_1;
	else
		tmp = x - (x * (y / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e+39], t$95$2, If[LessEqual[z, -45000000000000.0], t$95$1, If[LessEqual[z, -5e-9], t$95$2, If[LessEqual[z, 2e+22], t$95$1, N[(x - N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x}{\frac{t}{y - z}}\\
t_2 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+39}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -45000000000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -5 \cdot 10^{-9}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 2 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.8000000000000006e39 or -4.5e13 < z < -5.0000000000000001e-9

    1. Initial program 77.3%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 62.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg62.5%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{z}} \]
      2. associate-/l*80.1%

        \[\leadsto -\color{blue}{x \cdot \frac{y - z}{z}} \]
      3. distribute-rgt-neg-in80.1%

        \[\leadsto \color{blue}{x \cdot \left(-\frac{y - z}{z}\right)} \]
      4. distribute-frac-neg80.1%

        \[\leadsto x \cdot \color{blue}{\frac{-\left(y - z\right)}{z}} \]
      5. neg-sub080.1%

        \[\leadsto x \cdot \frac{\color{blue}{0 - \left(y - z\right)}}{z} \]
      6. associate--r-80.1%

        \[\leadsto x \cdot \frac{\color{blue}{\left(0 - y\right) + z}}{z} \]
      7. neg-sub080.1%

        \[\leadsto x \cdot \frac{\color{blue}{\left(-y\right)} + z}{z} \]
      8. +-commutative80.1%

        \[\leadsto x \cdot \frac{\color{blue}{z + \left(-y\right)}}{z} \]
      9. sub-neg80.1%

        \[\leadsto x \cdot \frac{\color{blue}{z - y}}{z} \]
      10. div-sub80.1%

        \[\leadsto x \cdot \color{blue}{\left(\frac{z}{z} - \frac{y}{z}\right)} \]
      11. *-inverses80.1%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{y}{z}\right) \]
    7. Simplified80.1%

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

    if -8.8000000000000006e39 < z < -4.5e13 or -5.0000000000000001e-9 < z < 2e22

    1. Initial program 90.3%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*96.3%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified96.3%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num96.1%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{t - z}{y - z}}} \]
      2. un-div-inv96.9%

        \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    6. Applied egg-rr96.9%

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    7. Taylor expanded in t around inf 84.4%

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

    if 2e22 < z

    1. Initial program 60.1%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*99.9%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 70.3%

      \[\leadsto \color{blue}{\left(x + -1 \cdot \frac{x \cdot y}{z}\right) - -1 \cdot \frac{t \cdot x}{z}} \]
    6. Step-by-step derivation
      1. associate--l+70.3%

        \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
      2. distribute-lft-out--70.3%

        \[\leadsto x + \color{blue}{-1 \cdot \left(\frac{x \cdot y}{z} - \frac{t \cdot x}{z}\right)} \]
      3. div-sub70.3%

        \[\leadsto x + -1 \cdot \color{blue}{\frac{x \cdot y - t \cdot x}{z}} \]
      4. mul-1-neg70.3%

        \[\leadsto x + \color{blue}{\left(-\frac{x \cdot y - t \cdot x}{z}\right)} \]
      5. unsub-neg70.3%

        \[\leadsto \color{blue}{x - \frac{x \cdot y - t \cdot x}{z}} \]
      6. *-commutative70.3%

        \[\leadsto x - \frac{x \cdot y - \color{blue}{x \cdot t}}{z} \]
      7. distribute-lft-out--70.5%

        \[\leadsto x - \frac{\color{blue}{x \cdot \left(y - t\right)}}{z} \]
    7. Simplified70.5%

      \[\leadsto \color{blue}{x - \frac{x \cdot \left(y - t\right)}{z}} \]
    8. Taylor expanded in y around inf 74.3%

      \[\leadsto x - \color{blue}{\frac{x \cdot y}{z}} \]
    9. Step-by-step derivation
      1. associate-/l*79.6%

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{z}} \]
    10. Simplified79.6%

      \[\leadsto x - \color{blue}{x \cdot \frac{y}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.8 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -45000000000000:\\ \;\;\;\;\frac{x}{\frac{t}{y - z}}\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+22}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 62.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.7 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -24000000000000 \lor \neg \left(z \leq -8.5 \cdot 10^{-10}\right) \land z \leq 1.95 \cdot 10^{+34}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -4.7e+39)
   x
   (if (or (<= z -24000000000000.0)
           (and (not (<= z -8.5e-10)) (<= z 1.95e+34)))
     (* x (/ y t))
     x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -4.7e+39) {
		tmp = x;
	} else if ((z <= -24000000000000.0) || (!(z <= -8.5e-10) && (z <= 1.95e+34))) {
		tmp = x * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-4.7d+39)) then
        tmp = x
    else if ((z <= (-24000000000000.0d0)) .or. (.not. (z <= (-8.5d-10))) .and. (z <= 1.95d+34)) then
        tmp = x * (y / t)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -4.7e+39) {
		tmp = x;
	} else if ((z <= -24000000000000.0) || (!(z <= -8.5e-10) && (z <= 1.95e+34))) {
		tmp = x * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -4.7e+39:
		tmp = x
	elif (z <= -24000000000000.0) or (not (z <= -8.5e-10) and (z <= 1.95e+34)):
		tmp = x * (y / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -4.7e+39)
		tmp = x;
	elseif ((z <= -24000000000000.0) || (!(z <= -8.5e-10) && (z <= 1.95e+34)))
		tmp = Float64(x * Float64(y / t));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -4.7e+39)
		tmp = x;
	elseif ((z <= -24000000000000.0) || (~((z <= -8.5e-10)) && (z <= 1.95e+34)))
		tmp = x * (y / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.7e+39], x, If[Or[LessEqual[z, -24000000000000.0], And[N[Not[LessEqual[z, -8.5e-10]], $MachinePrecision], LessEqual[z, 1.95e+34]]], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{+39}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -24000000000000 \lor \neg \left(z \leq -8.5 \cdot 10^{-10}\right) \land z \leq 1.95 \cdot 10^{+34}:\\
\;\;\;\;x \cdot \frac{y}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.6999999999999999e39 or -2.4e13 < z < -8.4999999999999996e-10 or 1.9500000000000001e34 < z

    1. Initial program 68.4%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 60.8%

      \[\leadsto \color{blue}{x} \]

    if -4.6999999999999999e39 < z < -2.4e13 or -8.4999999999999996e-10 < z < 1.9500000000000001e34

    1. Initial program 90.5%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*96.3%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified96.3%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 64.3%

      \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
    6. Step-by-step derivation
      1. associate-/l*70.2%

        \[\leadsto \color{blue}{x \cdot \frac{y}{t}} \]
    7. Simplified70.2%

      \[\leadsto \color{blue}{x \cdot \frac{y}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.7 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -24000000000000 \lor \neg \left(z \leq -8.5 \cdot 10^{-10}\right) \land z \leq 1.95 \cdot 10^{+34}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 62.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.8 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -25000000000000 \lor \neg \left(z \leq -1.22 \cdot 10^{-8}\right) \land z \leq 5.5 \cdot 10^{+35}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -8.8e+39)
   x
   (if (or (<= z -25000000000000.0) (and (not (<= z -1.22e-8)) (<= z 5.5e+35)))
     (/ x (/ t y))
     x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -8.8e+39) {
		tmp = x;
	} else if ((z <= -25000000000000.0) || (!(z <= -1.22e-8) && (z <= 5.5e+35))) {
		tmp = x / (t / y);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-8.8d+39)) then
        tmp = x
    else if ((z <= (-25000000000000.0d0)) .or. (.not. (z <= (-1.22d-8))) .and. (z <= 5.5d+35)) then
        tmp = x / (t / y)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -8.8e+39) {
		tmp = x;
	} else if ((z <= -25000000000000.0) || (!(z <= -1.22e-8) && (z <= 5.5e+35))) {
		tmp = x / (t / y);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -8.8e+39:
		tmp = x
	elif (z <= -25000000000000.0) or (not (z <= -1.22e-8) and (z <= 5.5e+35)):
		tmp = x / (t / y)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -8.8e+39)
		tmp = x;
	elseif ((z <= -25000000000000.0) || (!(z <= -1.22e-8) && (z <= 5.5e+35)))
		tmp = Float64(x / Float64(t / y));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -8.8e+39)
		tmp = x;
	elseif ((z <= -25000000000000.0) || (~((z <= -1.22e-8)) && (z <= 5.5e+35)))
		tmp = x / (t / y);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.8e+39], x, If[Or[LessEqual[z, -25000000000000.0], And[N[Not[LessEqual[z, -1.22e-8]], $MachinePrecision], LessEqual[z, 5.5e+35]]], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+39}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -25000000000000 \lor \neg \left(z \leq -1.22 \cdot 10^{-8}\right) \land z \leq 5.5 \cdot 10^{+35}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.8000000000000006e39 or -2.5e13 < z < -1.22e-8 or 5.50000000000000001e35 < z

    1. Initial program 68.4%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 60.8%

      \[\leadsto \color{blue}{x} \]

    if -8.8000000000000006e39 < z < -2.5e13 or -1.22e-8 < z < 5.50000000000000001e35

    1. Initial program 90.5%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*96.3%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified96.3%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num96.2%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{t - z}{y - z}}} \]
      2. un-div-inv97.0%

        \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    6. Applied egg-rr97.0%

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    7. Taylor expanded in z around 0 70.2%

      \[\leadsto \frac{x}{\color{blue}{\frac{t}{y}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.8 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -25000000000000 \lor \neg \left(z \leq -1.22 \cdot 10^{-8}\right) \land z \leq 5.5 \cdot 10^{+35}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 71.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{-73}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -4.6e-73)
   (* x (/ z (- z t)))
   (if (<= z 6.5e-54) (/ x (/ t y)) (* x (- 1.0 (/ y z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -4.6e-73) {
		tmp = x * (z / (z - t));
	} else if (z <= 6.5e-54) {
		tmp = x / (t / y);
	} else {
		tmp = x * (1.0 - (y / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-4.6d-73)) then
        tmp = x * (z / (z - t))
    else if (z <= 6.5d-54) then
        tmp = x / (t / y)
    else
        tmp = x * (1.0d0 - (y / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -4.6e-73) {
		tmp = x * (z / (z - t));
	} else if (z <= 6.5e-54) {
		tmp = x / (t / y);
	} else {
		tmp = x * (1.0 - (y / z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -4.6e-73:
		tmp = x * (z / (z - t))
	elif z <= 6.5e-54:
		tmp = x / (t / y)
	else:
		tmp = x * (1.0 - (y / z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -4.6e-73)
		tmp = Float64(x * Float64(z / Float64(z - t)));
	elseif (z <= 6.5e-54)
		tmp = Float64(x / Float64(t / y));
	else
		tmp = Float64(x * Float64(1.0 - Float64(y / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -4.6e-73)
		tmp = x * (z / (z - t));
	elseif (z <= 6.5e-54)
		tmp = x / (t / y);
	else
		tmp = x * (1.0 - (y / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.6e-73], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-54], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-73}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\

\mathbf{elif}\;z \leq 6.5 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.59999999999999977e-73

    1. Initial program 80.4%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*99.8%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 60.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{t - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg60.8%

        \[\leadsto \color{blue}{-\frac{x \cdot z}{t - z}} \]
      2. distribute-neg-frac260.8%

        \[\leadsto \color{blue}{\frac{x \cdot z}{-\left(t - z\right)}} \]
      3. neg-sub060.8%

        \[\leadsto \frac{x \cdot z}{\color{blue}{0 - \left(t - z\right)}} \]
      4. associate--r-60.8%

        \[\leadsto \frac{x \cdot z}{\color{blue}{\left(0 - t\right) + z}} \]
      5. neg-sub060.8%

        \[\leadsto \frac{x \cdot z}{\color{blue}{\left(-t\right)} + z} \]
      6. +-commutative60.8%

        \[\leadsto \frac{x \cdot z}{\color{blue}{z + \left(-t\right)}} \]
      7. sub-neg60.8%

        \[\leadsto \frac{x \cdot z}{\color{blue}{z - t}} \]
      8. associate-/l*73.2%

        \[\leadsto \color{blue}{x \cdot \frac{z}{z - t}} \]
    7. Simplified73.2%

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

    if -4.59999999999999977e-73 < z < 6.49999999999999991e-54

    1. Initial program 90.1%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*96.0%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified96.0%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num95.9%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{t - z}{y - z}}} \]
      2. un-div-inv96.1%

        \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    6. Applied egg-rr96.1%

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    7. Taylor expanded in z around 0 78.0%

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

    if 6.49999999999999991e-54 < z

    1. Initial program 66.6%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-/l*98.7%

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    3. Simplified98.7%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 50.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg50.4%

        \[\leadsto \color{blue}{-\frac{x \cdot \left(y - z\right)}{z}} \]
      2. associate-/l*72.5%

        \[\leadsto -\color{blue}{x \cdot \frac{y - z}{z}} \]
      3. distribute-rgt-neg-in72.5%

        \[\leadsto \color{blue}{x \cdot \left(-\frac{y - z}{z}\right)} \]
      4. distribute-frac-neg72.5%

        \[\leadsto x \cdot \color{blue}{\frac{-\left(y - z\right)}{z}} \]
      5. neg-sub072.5%

        \[\leadsto x \cdot \frac{\color{blue}{0 - \left(y - z\right)}}{z} \]
      6. associate--r-72.5%

        \[\leadsto x \cdot \frac{\color{blue}{\left(0 - y\right) + z}}{z} \]
      7. neg-sub072.5%

        \[\leadsto x \cdot \frac{\color{blue}{\left(-y\right)} + z}{z} \]
      8. +-commutative72.5%

        \[\leadsto x \cdot \frac{\color{blue}{z + \left(-y\right)}}{z} \]
      9. sub-neg72.5%

        \[\leadsto x \cdot \frac{\color{blue}{z - y}}{z} \]
      10. div-sub72.5%

        \[\leadsto x \cdot \color{blue}{\left(\frac{z}{z} - \frac{y}{z}\right)} \]
      11. *-inverses72.5%

        \[\leadsto x \cdot \left(\color{blue}{1} - \frac{y}{z}\right) \]
    7. Simplified72.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{-73}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 97.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \frac{y - z}{t - z} \end{array} \]
(FPCore (x y z t) :precision binary64 (* x (/ (- y z) (- t z))))
double code(double x, double y, double z, double t) {
	return x * ((y - z) / (t - z));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x * ((y - z) / (t - z))
end function
public static double code(double x, double y, double z, double t) {
	return x * ((y - z) / (t - z));
}
def code(x, y, z, t):
	return x * ((y - z) / (t - z))
function code(x, y, z, t)
	return Float64(x * Float64(Float64(y - z) / Float64(t - z)))
end
function tmp = code(x, y, z, t)
	tmp = x * ((y - z) / (t - z));
end
code[x_, y_, z_, t_] := N[(x * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \frac{y - z}{t - z}
\end{array}
Derivation
  1. Initial program 80.4%

    \[\frac{x \cdot \left(y - z\right)}{t - z} \]
  2. Step-by-step derivation
    1. associate-/l*97.9%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
  4. Add Preprocessing
  5. Final simplification97.9%

    \[\leadsto x \cdot \frac{y - z}{t - z} \]
  6. Add Preprocessing

Alternative 10: 35.6% accurate, 9.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 80.4%

    \[\frac{x \cdot \left(y - z\right)}{t - z} \]
  2. Step-by-step derivation
    1. associate-/l*97.9%

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
  3. Simplified97.9%

    \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
  4. Add Preprocessing
  5. Taylor expanded in z around inf 33.1%

    \[\leadsto \color{blue}{x} \]
  6. Final simplification33.1%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 97.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x}{\frac{t - z}{y - z}} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
	return x / ((t - z) / (y - z));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
	return x / ((t - z) / (y - z));
}
def code(x, y, z, t):
	return x / ((t - z) / (y - z))
function code(x, y, z, t)
	return Float64(x / Float64(Float64(t - z) / Float64(y - z)))
end
function tmp = code(x, y, z, t)
	tmp = x / ((t - z) / (y - z));
end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}

Reproduce

?
herbie shell --seed 2024073 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

  :alt
  (/ x (/ (- t z) (- y z)))

  (/ (* x (- y z)) (- t z)))