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

Percentage Accurate: 84.0% → 96.8%
Time: 10.0s
Alternatives: 11
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 11 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.0% 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: 96.8% 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 86.9%

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

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

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

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

Alternative 2: 66.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{if}\;z \leq -4.4 \cdot 10^{-70}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 10^{-137}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-49} \lor \neg \left(z \leq 1.3 \cdot 10^{+16}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ y z)))))
   (if (<= z -4.4e-70)
     t_1
     (if (<= z 1e-137)
       (/ (* x y) t)
       (if (or (<= z 1.35e-49) (not (<= z 1.3e+16))) t_1 (* y (/ x t)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / z));
	double tmp;
	if (z <= -4.4e-70) {
		tmp = t_1;
	} else if (z <= 1e-137) {
		tmp = (x * y) / t;
	} else if ((z <= 1.35e-49) || !(z <= 1.3e+16)) {
		tmp = t_1;
	} else {
		tmp = y * (x / 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) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - (y / z))
    if (z <= (-4.4d-70)) then
        tmp = t_1
    else if (z <= 1d-137) then
        tmp = (x * y) / t
    else if ((z <= 1.35d-49) .or. (.not. (z <= 1.3d+16))) then
        tmp = t_1
    else
        tmp = y * (x / t)
    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 <= -4.4e-70) {
		tmp = t_1;
	} else if (z <= 1e-137) {
		tmp = (x * y) / t;
	} else if ((z <= 1.35e-49) || !(z <= 1.3e+16)) {
		tmp = t_1;
	} else {
		tmp = y * (x / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - (y / z))
	tmp = 0
	if z <= -4.4e-70:
		tmp = t_1
	elif z <= 1e-137:
		tmp = (x * y) / t
	elif (z <= 1.35e-49) or not (z <= 1.3e+16):
		tmp = t_1
	else:
		tmp = y * (x / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - Float64(y / z)))
	tmp = 0.0
	if (z <= -4.4e-70)
		tmp = t_1;
	elseif (z <= 1e-137)
		tmp = Float64(Float64(x * y) / t);
	elseif ((z <= 1.35e-49) || !(z <= 1.3e+16))
		tmp = t_1;
	else
		tmp = Float64(y * Float64(x / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - (y / z));
	tmp = 0.0;
	if (z <= -4.4e-70)
		tmp = t_1;
	elseif (z <= 1e-137)
		tmp = (x * y) / t;
	elseif ((z <= 1.35e-49) || ~((z <= 1.3e+16)))
		tmp = t_1;
	else
		tmp = y * (x / t);
	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, -4.4e-70], t$95$1, If[LessEqual[z, 1e-137], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, 1.35e-49], N[Not[LessEqual[z, 1.3e+16]], $MachinePrecision]], t$95$1, N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-49} \lor \neg \left(z \leq 1.3 \cdot 10^{+16}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.3999999999999998e-70 or 9.99999999999999978e-138 < z < 1.35e-49 or 1.3e16 < z

    1. Initial program 83.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 t around 0 58.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.3999999999999998e-70 < z < 9.99999999999999978e-138

    1. Initial program 93.8%

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

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

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

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

    if 1.35e-49 < z < 1.3e16

    1. Initial program 92.0%

      \[\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. Step-by-step derivation
      1. clear-num99.5%

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    7. Step-by-step derivation
      1. div-sub99.6%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
    10. Step-by-step derivation
      1. *-rgt-identity58.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{t \cdot 1}} \]
      2. times-frac65.8%

        \[\leadsto \color{blue}{\frac{x}{t} \cdot \frac{y}{1}} \]
      3. /-rgt-identity65.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{-70}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 10^{-137}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-49} \lor \neg \left(z \leq 1.3 \cdot 10^{+16}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x \cdot y}{t - z}\\ \mathbf{if}\;y \leq -1.3 \cdot 10^{+165}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{+109}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{+47}:\\ \;\;\;\;y \cdot \frac{x}{t - z}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-5}:\\ \;\;\;\;\frac{x}{1 - \frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (* x y) (- t z))))
   (if (<= y -1.3e+165)
     t_1
     (if (<= y -4.6e+109)
       (* x (- 1.0 (/ y z)))
       (if (<= y -1.35e+47)
         (* y (/ x (- t z)))
         (if (<= y 3.5e-5) (/ x (- 1.0 (/ t z))) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * y) / (t - z);
	double tmp;
	if (y <= -1.3e+165) {
		tmp = t_1;
	} else if (y <= -4.6e+109) {
		tmp = x * (1.0 - (y / z));
	} else if (y <= -1.35e+47) {
		tmp = y * (x / (t - z));
	} else if (y <= 3.5e-5) {
		tmp = x / (1.0 - (t / z));
	} 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 * y) / (t - z)
    if (y <= (-1.3d+165)) then
        tmp = t_1
    else if (y <= (-4.6d+109)) then
        tmp = x * (1.0d0 - (y / z))
    else if (y <= (-1.35d+47)) then
        tmp = y * (x / (t - z))
    else if (y <= 3.5d-5) then
        tmp = x / (1.0d0 - (t / z))
    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 * y) / (t - z);
	double tmp;
	if (y <= -1.3e+165) {
		tmp = t_1;
	} else if (y <= -4.6e+109) {
		tmp = x * (1.0 - (y / z));
	} else if (y <= -1.35e+47) {
		tmp = y * (x / (t - z));
	} else if (y <= 3.5e-5) {
		tmp = x / (1.0 - (t / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * y) / (t - z)
	tmp = 0
	if y <= -1.3e+165:
		tmp = t_1
	elif y <= -4.6e+109:
		tmp = x * (1.0 - (y / z))
	elif y <= -1.35e+47:
		tmp = y * (x / (t - z))
	elif y <= 3.5e-5:
		tmp = x / (1.0 - (t / z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * y) / Float64(t - z))
	tmp = 0.0
	if (y <= -1.3e+165)
		tmp = t_1;
	elseif (y <= -4.6e+109)
		tmp = Float64(x * Float64(1.0 - Float64(y / z)));
	elseif (y <= -1.35e+47)
		tmp = Float64(y * Float64(x / Float64(t - z)));
	elseif (y <= 3.5e-5)
		tmp = Float64(x / Float64(1.0 - Float64(t / z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * y) / (t - z);
	tmp = 0.0;
	if (y <= -1.3e+165)
		tmp = t_1;
	elseif (y <= -4.6e+109)
		tmp = x * (1.0 - (y / z));
	elseif (y <= -1.35e+47)
		tmp = y * (x / (t - z));
	elseif (y <= 3.5e-5)
		tmp = x / (1.0 - (t / z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e+165], t$95$1, If[LessEqual[y, -4.6e+109], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.35e+47], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e-5], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{t - z}\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -4.6 \cdot 10^{+109}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\

\mathbf{elif}\;y \leq -1.35 \cdot 10^{+47}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.3000000000000001e165 or 3.4999999999999997e-5 < y

    1. Initial program 88.5%

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

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

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

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

    if -1.3000000000000001e165 < y < -4.60000000000000021e109

    1. Initial program 92.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 t around 0 85.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.60000000000000021e109 < y < -1.34999999999999998e47

    1. Initial program 99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot y} \]
      2. *-commutative85.8%

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

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

    if -1.34999999999999998e47 < y < 3.4999999999999997e-5

    1. Initial program 84.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    7. Step-by-step derivation
      1. div-sub98.5%

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + -1 \cdot \frac{t}{z}}} \]
    10. Step-by-step derivation
      1. mul-1-neg85.4%

        \[\leadsto \frac{x}{1 + \color{blue}{\left(-\frac{t}{z}\right)}} \]
      2. unsub-neg85.4%

        \[\leadsto \frac{x}{\color{blue}{1 - \frac{t}{z}}} \]
    11. Simplified85.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{+165}:\\ \;\;\;\;\frac{x \cdot y}{t - z}\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{+109}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{+47}:\\ \;\;\;\;y \cdot \frac{x}{t - z}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-5}:\\ \;\;\;\;\frac{x}{1 - \frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{t - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 71.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x \cdot y}{t - z}\\ \mathbf{if}\;y \leq -1.12 \cdot 10^{+184}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.25 \cdot 10^{+102}:\\ \;\;\;\;x - \frac{x \cdot y}{z}\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \frac{x}{t - z}\\ \mathbf{elif}\;y \leq 0.00078:\\ \;\;\;\;\frac{x}{1 - \frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (* x y) (- t z))))
   (if (<= y -1.12e+184)
     t_1
     (if (<= y -2.25e+102)
       (- x (/ (* x y) z))
       (if (<= y -2.2e+48)
         (* y (/ x (- t z)))
         (if (<= y 0.00078) (/ x (- 1.0 (/ t z))) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * y) / (t - z);
	double tmp;
	if (y <= -1.12e+184) {
		tmp = t_1;
	} else if (y <= -2.25e+102) {
		tmp = x - ((x * y) / z);
	} else if (y <= -2.2e+48) {
		tmp = y * (x / (t - z));
	} else if (y <= 0.00078) {
		tmp = x / (1.0 - (t / z));
	} 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 * y) / (t - z)
    if (y <= (-1.12d+184)) then
        tmp = t_1
    else if (y <= (-2.25d+102)) then
        tmp = x - ((x * y) / z)
    else if (y <= (-2.2d+48)) then
        tmp = y * (x / (t - z))
    else if (y <= 0.00078d0) then
        tmp = x / (1.0d0 - (t / z))
    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 * y) / (t - z);
	double tmp;
	if (y <= -1.12e+184) {
		tmp = t_1;
	} else if (y <= -2.25e+102) {
		tmp = x - ((x * y) / z);
	} else if (y <= -2.2e+48) {
		tmp = y * (x / (t - z));
	} else if (y <= 0.00078) {
		tmp = x / (1.0 - (t / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * y) / (t - z)
	tmp = 0
	if y <= -1.12e+184:
		tmp = t_1
	elif y <= -2.25e+102:
		tmp = x - ((x * y) / z)
	elif y <= -2.2e+48:
		tmp = y * (x / (t - z))
	elif y <= 0.00078:
		tmp = x / (1.0 - (t / z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * y) / Float64(t - z))
	tmp = 0.0
	if (y <= -1.12e+184)
		tmp = t_1;
	elseif (y <= -2.25e+102)
		tmp = Float64(x - Float64(Float64(x * y) / z));
	elseif (y <= -2.2e+48)
		tmp = Float64(y * Float64(x / Float64(t - z)));
	elseif (y <= 0.00078)
		tmp = Float64(x / Float64(1.0 - Float64(t / z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * y) / (t - z);
	tmp = 0.0;
	if (y <= -1.12e+184)
		tmp = t_1;
	elseif (y <= -2.25e+102)
		tmp = x - ((x * y) / z);
	elseif (y <= -2.2e+48)
		tmp = y * (x / (t - z));
	elseif (y <= 0.00078)
		tmp = x / (1.0 - (t / z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.12e+184], t$95$1, If[LessEqual[y, -2.25e+102], N[(x - N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.2e+48], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00078], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{t - z}\\
\mathbf{if}\;y \leq -1.12 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -2.25 \cdot 10^{+102}:\\
\;\;\;\;x - \frac{x \cdot y}{z}\\

\mathbf{elif}\;y \leq -2.2 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\

\mathbf{elif}\;y \leq 0.00078:\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.12000000000000007e184 or 7.79999999999999986e-4 < y

    1. Initial program 88.4%

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

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

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

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

    if -1.12000000000000007e184 < y < -2.2500000000000001e102

    1. Initial program 92.9%

      \[\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 t around 0 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2500000000000001e102 < y < -2.1999999999999999e48

    1. Initial program 99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot y} \]
      2. *-commutative85.8%

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

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

    if -2.1999999999999999e48 < y < 7.79999999999999986e-4

    1. Initial program 84.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}} \]
    7. Step-by-step derivation
      1. div-sub98.5%

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

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

      \[\leadsto \color{blue}{\frac{x}{1 + -1 \cdot \frac{t}{z}}} \]
    10. Step-by-step derivation
      1. mul-1-neg85.4%

        \[\leadsto \frac{x}{1 + \color{blue}{\left(-\frac{t}{z}\right)}} \]
      2. unsub-neg85.4%

        \[\leadsto \frac{x}{\color{blue}{1 - \frac{t}{z}}} \]
    11. Simplified85.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{+184}:\\ \;\;\;\;\frac{x \cdot y}{t - z}\\ \mathbf{elif}\;y \leq -2.25 \cdot 10^{+102}:\\ \;\;\;\;x - \frac{x \cdot y}{z}\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \frac{x}{t - z}\\ \mathbf{elif}\;y \leq 0.00078:\\ \;\;\;\;\frac{x}{1 - \frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{t - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 58.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -940000000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-161}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-117}:\\ \;\;\;\;\frac{x \cdot y}{-z}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+72}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -940000000.0)
   x
   (if (<= z 1.95e-161)
     (/ (* x y) t)
     (if (<= z 4.6e-117)
       (/ (* x y) (- z))
       (if (<= z 3.2e+72) (* x (/ y t)) x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -940000000.0) {
		tmp = x;
	} else if (z <= 1.95e-161) {
		tmp = (x * y) / t;
	} else if (z <= 4.6e-117) {
		tmp = (x * y) / -z;
	} else if (z <= 3.2e+72) {
		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 <= (-940000000.0d0)) then
        tmp = x
    else if (z <= 1.95d-161) then
        tmp = (x * y) / t
    else if (z <= 4.6d-117) then
        tmp = (x * y) / -z
    else if (z <= 3.2d+72) 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 <= -940000000.0) {
		tmp = x;
	} else if (z <= 1.95e-161) {
		tmp = (x * y) / t;
	} else if (z <= 4.6e-117) {
		tmp = (x * y) / -z;
	} else if (z <= 3.2e+72) {
		tmp = x * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -940000000.0:
		tmp = x
	elif z <= 1.95e-161:
		tmp = (x * y) / t
	elif z <= 4.6e-117:
		tmp = (x * y) / -z
	elif z <= 3.2e+72:
		tmp = x * (y / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -940000000.0)
		tmp = x;
	elseif (z <= 1.95e-161)
		tmp = Float64(Float64(x * y) / t);
	elseif (z <= 4.6e-117)
		tmp = Float64(Float64(x * y) / Float64(-z));
	elseif (z <= 3.2e+72)
		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 <= -940000000.0)
		tmp = x;
	elseif (z <= 1.95e-161)
		tmp = (x * y) / t;
	elseif (z <= 4.6e-117)
		tmp = (x * y) / -z;
	elseif (z <= 3.2e+72)
		tmp = x * (y / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -940000000.0], x, If[LessEqual[z, 1.95e-161], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 4.6e-117], N[(N[(x * y), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 3.2e+72], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -940000000:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 4.6 \cdot 10^{-117}:\\
\;\;\;\;\frac{x \cdot y}{-z}\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+72}:\\
\;\;\;\;x \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9.4e8 or 3.2000000000000001e72 < z

    1. Initial program 77.6%

      \[\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 63.1%

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

    if -9.4e8 < z < 1.94999999999999987e-161

    1. Initial program 94.5%

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

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

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

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

    if 1.94999999999999987e-161 < z < 4.59999999999999989e-117

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.59999999999999989e-117 < z < 3.2000000000000001e72

    1. Initial program 97.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 0 44.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -940000000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-161}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-117}:\\ \;\;\;\;\frac{x \cdot y}{-z}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+72}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 64.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -170000:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-55}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -170000.0)
   (* x (/ z (- z t)))
   (if (<= t 5e-55) (* x (- 1.0 (/ y z))) (* x (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -170000.0) {
		tmp = x * (z / (z - t));
	} else if (t <= 5e-55) {
		tmp = x * (1.0 - (y / z));
	} else {
		tmp = x * (y / 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 (t <= (-170000.0d0)) then
        tmp = x * (z / (z - t))
    else if (t <= 5d-55) then
        tmp = x * (1.0d0 - (y / z))
    else
        tmp = x * (y / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -170000.0) {
		tmp = x * (z / (z - t));
	} else if (t <= 5e-55) {
		tmp = x * (1.0 - (y / z));
	} else {
		tmp = x * (y / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -170000.0:
		tmp = x * (z / (z - t))
	elif t <= 5e-55:
		tmp = x * (1.0 - (y / z))
	else:
		tmp = x * (y / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -170000.0)
		tmp = Float64(x * Float64(z / Float64(z - t)));
	elseif (t <= 5e-55)
		tmp = Float64(x * Float64(1.0 - Float64(y / z)));
	else
		tmp = Float64(x * Float64(y / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -170000.0)
		tmp = x * (z / (z - t));
	elseif (t <= 5e-55)
		tmp = x * (1.0 - (y / z));
	else
		tmp = x * (y / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -170000.0], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e-55], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -170000:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\

\mathbf{elif}\;t \leq 5 \cdot 10^{-55}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.7e5

    1. Initial program 82.7%

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

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

      \[\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*75.1%

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

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

    if -1.7e5 < t < 5.0000000000000002e-55

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000002e-55 < t

    1. Initial program 90.1%

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

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

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

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

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

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

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

Alternative 7: 70.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1500:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-55}:\\ \;\;\;\;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 (<= t -1500.0)
   (* x (/ z (- z t)))
   (if (<= t 5e-55) (* x (- 1.0 (/ y z))) (* x (/ (- y z) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1500.0) {
		tmp = x * (z / (z - t));
	} else if (t <= 5e-55) {
		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 (t <= (-1500.0d0)) then
        tmp = x * (z / (z - t))
    else if (t <= 5d-55) 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 (t <= -1500.0) {
		tmp = x * (z / (z - t));
	} else if (t <= 5e-55) {
		tmp = x * (1.0 - (y / z));
	} else {
		tmp = x * ((y - z) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -1500.0:
		tmp = x * (z / (z - t))
	elif t <= 5e-55:
		tmp = x * (1.0 - (y / z))
	else:
		tmp = x * ((y - z) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -1500.0)
		tmp = Float64(x * Float64(z / Float64(z - t)));
	elseif (t <= 5e-55)
		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 (t <= -1500.0)
		tmp = x * (z / (z - t));
	elseif (t <= 5e-55)
		tmp = x * (1.0 - (y / z));
	else
		tmp = x * ((y - z) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -1500.0], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e-55], 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}\;t \leq -1500:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\

\mathbf{elif}\;t \leq 5 \cdot 10^{-55}:\\
\;\;\;\;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 3 regimes
  2. if t < -1500

    1. Initial program 82.7%

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

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

      \[\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*75.1%

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

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

    if -1500 < t < 5.0000000000000002e-55

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000002e-55 < t

    1. Initial program 90.1%

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

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

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

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

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

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

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

Alternative 8: 70.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -31000:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-55}:\\ \;\;\;\;x - x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -31000.0)
   (* x (/ z (- z t)))
   (if (<= t 5e-55) (- x (* x (/ y z))) (* x (/ (- y z) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -31000.0) {
		tmp = x * (z / (z - t));
	} else if (t <= 5e-55) {
		tmp = x - (x * (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 (t <= (-31000.0d0)) then
        tmp = x * (z / (z - t))
    else if (t <= 5d-55) then
        tmp = x - (x * (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 (t <= -31000.0) {
		tmp = x * (z / (z - t));
	} else if (t <= 5e-55) {
		tmp = x - (x * (y / z));
	} else {
		tmp = x * ((y - z) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -31000.0:
		tmp = x * (z / (z - t))
	elif t <= 5e-55:
		tmp = x - (x * (y / z))
	else:
		tmp = x * ((y - z) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -31000.0)
		tmp = Float64(x * Float64(z / Float64(z - t)));
	elseif (t <= 5e-55)
		tmp = Float64(x - Float64(x * 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 (t <= -31000.0)
		tmp = x * (z / (z - t));
	elseif (t <= 5e-55)
		tmp = x - (x * (y / z));
	else
		tmp = x * ((y - z) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -31000.0], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e-55], N[(x - N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -31000:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -31000

    1. Initial program 82.7%

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

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

      \[\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*75.1%

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

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

    if -31000 < t < 5.0000000000000002e-55

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \frac{x \cdot \left(-y\right)}{z}} \]
    11. Step-by-step derivation
      1. div-inv82.4%

        \[\leadsto x + \color{blue}{\left(x \cdot \left(-y\right)\right) \cdot \frac{1}{z}} \]
      2. *-commutative82.4%

        \[\leadsto x + \color{blue}{\left(\left(-y\right) \cdot x\right)} \cdot \frac{1}{z} \]
      3. add-sqr-sqrt41.1%

        \[\leadsto x + \left(\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot x\right) \cdot \frac{1}{z} \]
      4. sqrt-unprod54.6%

        \[\leadsto x + \left(\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}} \cdot x\right) \cdot \frac{1}{z} \]
      5. sqr-neg54.6%

        \[\leadsto x + \left(\sqrt{\color{blue}{y \cdot y}} \cdot x\right) \cdot \frac{1}{z} \]
      6. sqrt-unprod22.2%

        \[\leadsto x + \left(\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot x\right) \cdot \frac{1}{z} \]
      7. add-sqr-sqrt45.5%

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

        \[\leadsto x + \color{blue}{\left(x \cdot y\right)} \cdot \frac{1}{z} \]
      9. remove-double-neg45.5%

        \[\leadsto x + \color{blue}{\left(-\left(-x \cdot y\right)\right)} \cdot \frac{1}{z} \]
      10. distribute-rgt-neg-out45.5%

        \[\leadsto x + \left(-\color{blue}{x \cdot \left(-y\right)}\right) \cdot \frac{1}{z} \]
      11. cancel-sign-sub-inv45.5%

        \[\leadsto \color{blue}{x - \left(x \cdot \left(-y\right)\right) \cdot \frac{1}{z}} \]
      12. associate-*l*46.6%

        \[\leadsto x - \color{blue}{x \cdot \left(\left(-y\right) \cdot \frac{1}{z}\right)} \]
      13. div-inv46.6%

        \[\leadsto x - x \cdot \color{blue}{\frac{-y}{z}} \]
      14. add-sqr-sqrt23.6%

        \[\leadsto x - x \cdot \frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{z} \]
      15. sqrt-unprod56.6%

        \[\leadsto x - x \cdot \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{z} \]
      16. sqr-neg56.6%

        \[\leadsto x - x \cdot \frac{\sqrt{\color{blue}{y \cdot y}}}{z} \]
      17. sqrt-unprod40.5%

        \[\leadsto x - x \cdot \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z} \]
      18. add-sqr-sqrt80.9%

        \[\leadsto x - x \cdot \frac{\color{blue}{y}}{z} \]
    12. Applied egg-rr80.9%

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

    if 5.0000000000000002e-55 < t

    1. Initial program 90.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -31000:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-55}:\\ \;\;\;\;x - x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 60.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1050000000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.65 \cdot 10^{+72}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1050000000.0) x (if (<= z 2.65e+72) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1050000000.0) {
		tmp = x;
	} else if (z <= 2.65e+72) {
		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 <= (-1050000000.0d0)) then
        tmp = x
    else if (z <= 2.65d+72) 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 <= -1050000000.0) {
		tmp = x;
	} else if (z <= 2.65e+72) {
		tmp = x * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1050000000.0:
		tmp = x
	elif z <= 2.65e+72:
		tmp = x * (y / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1050000000.0)
		tmp = x;
	elseif (z <= 2.65e+72)
		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 <= -1050000000.0)
		tmp = x;
	elseif (z <= 2.65e+72)
		tmp = x * (y / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1050000000.0], x, If[LessEqual[z, 2.65e+72], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1050000000:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.65 \cdot 10^{+72}:\\
\;\;\;\;x \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.05e9 or 2.6500000000000001e72 < z

    1. Initial program 77.6%

      \[\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 63.1%

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

    if -1.05e9 < z < 2.6500000000000001e72

    1. Initial program 95.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1050000000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.65 \cdot 10^{+72}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 59.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -27500000000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+72}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -27500000000.0) x (if (<= z 2.9e+72) (/ (* x y) t) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -27500000000.0) {
		tmp = x;
	} else if (z <= 2.9e+72) {
		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 <= (-27500000000.0d0)) then
        tmp = x
    else if (z <= 2.9d+72) 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 <= -27500000000.0) {
		tmp = x;
	} else if (z <= 2.9e+72) {
		tmp = (x * y) / t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -27500000000.0:
		tmp = x
	elif z <= 2.9e+72:
		tmp = (x * y) / t
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -27500000000.0)
		tmp = x;
	elseif (z <= 2.9e+72)
		tmp = Float64(Float64(x * y) / t);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -27500000000.0)
		tmp = x;
	elseif (z <= 2.9e+72)
		tmp = (x * y) / t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -27500000000.0], x, If[LessEqual[z, 2.9e+72], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -27500000000:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+72}:\\
\;\;\;\;\frac{x \cdot y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.75e10 or 2.90000000000000017e72 < z

    1. Initial program 77.6%

      \[\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 63.1%

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

    if -2.75e10 < z < 2.90000000000000017e72

    1. Initial program 95.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -27500000000:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+72}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 34.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 86.9%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification35.2%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 96.9% 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 2024066 
(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)))