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

Percentage Accurate: 84.3% → 96.9%
Time: 9.9s
Alternatives: 12
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 12 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.3% 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.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}
Derivation
  1. Initial program 82.9%

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

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

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

      \[\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. Final simplification96.9%

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

Alternative 2: 73.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+46} \lor \neg \left(z \leq -160000000\right) \land \left(z \leq -3.5 \cdot 10^{-89} \lor \neg \left(z \leq 6.8 \cdot 10^{+16}\right)\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -3.1e+46)
         (and (not (<= z -160000000.0))
              (or (<= z -3.5e-89) (not (<= z 6.8e+16)))))
   (* x (- 1.0 (/ y z)))
   (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -3.1e+46) || (!(z <= -160000000.0) && ((z <= -3.5e-89) || !(z <= 6.8e+16)))) {
		tmp = x * (1.0 - (y / z));
	} else {
		tmp = x * (y / (t - 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 <= (-3.1d+46)) .or. (.not. (z <= (-160000000.0d0))) .and. (z <= (-3.5d-89)) .or. (.not. (z <= 6.8d+16))) then
        tmp = x * (1.0d0 - (y / z))
    else
        tmp = x * (y / (t - z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -3.1e+46) || (!(z <= -160000000.0) && ((z <= -3.5e-89) || !(z <= 6.8e+16)))) {
		tmp = x * (1.0 - (y / z));
	} else {
		tmp = x * (y / (t - z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -3.1e+46) or (not (z <= -160000000.0) and ((z <= -3.5e-89) or not (z <= 6.8e+16))):
		tmp = x * (1.0 - (y / z))
	else:
		tmp = x * (y / (t - z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -3.1e+46) || (!(z <= -160000000.0) && ((z <= -3.5e-89) || !(z <= 6.8e+16))))
		tmp = Float64(x * Float64(1.0 - Float64(y / z)));
	else
		tmp = Float64(x * Float64(y / Float64(t - z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -3.1e+46) || (~((z <= -160000000.0)) && ((z <= -3.5e-89) || ~((z <= 6.8e+16)))))
		tmp = x * (1.0 - (y / z));
	else
		tmp = x * (y / (t - z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.1e+46], And[N[Not[LessEqual[z, -160000000.0]], $MachinePrecision], Or[LessEqual[z, -3.5e-89], N[Not[LessEqual[z, 6.8e+16]], $MachinePrecision]]]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+46} \lor \neg \left(z \leq -160000000\right) \land \left(z \leq -3.5 \cdot 10^{-89} \lor \neg \left(z \leq 6.8 \cdot 10^{+16}\right)\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.09999999999999975e46 or -1.6e8 < z < -3.4999999999999997e-89 or 6.8e16 < z

    1. Initial program 73.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.09999999999999975e46 < z < -1.6e8 or -3.4999999999999997e-89 < z < 6.8e16

    1. Initial program 93.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+46} \lor \neg \left(z \leq -160000000\right) \land \left(z \leq -3.5 \cdot 10^{-89} \lor \neg \left(z \leq 6.8 \cdot 10^{+16}\right)\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{z}{z - t}\\ t_2 := x \cdot \frac{y}{t - z}\\ \mathbf{if}\;y \leq -3.5 \cdot 10^{+84}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-80}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.45 \cdot 10^{-100}:\\ \;\;\;\;\frac{y}{\frac{t}{x}}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+113}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ z (- z t)))) (t_2 (* x (/ y (- t z)))))
   (if (<= y -3.5e+84)
     t_2
     (if (<= y -1.1e-80)
       t_1
       (if (<= y -4.45e-100) (/ y (/ t x)) (if (<= y 9e+113) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (z / (z - t));
	double t_2 = x * (y / (t - z));
	double tmp;
	if (y <= -3.5e+84) {
		tmp = t_2;
	} else if (y <= -1.1e-80) {
		tmp = t_1;
	} else if (y <= -4.45e-100) {
		tmp = y / (t / x);
	} else if (y <= 9e+113) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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 * (z / (z - t))
    t_2 = x * (y / (t - z))
    if (y <= (-3.5d+84)) then
        tmp = t_2
    else if (y <= (-1.1d-80)) then
        tmp = t_1
    else if (y <= (-4.45d-100)) then
        tmp = y / (t / x)
    else if (y <= 9d+113) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (z / (z - t));
	double t_2 = x * (y / (t - z));
	double tmp;
	if (y <= -3.5e+84) {
		tmp = t_2;
	} else if (y <= -1.1e-80) {
		tmp = t_1;
	} else if (y <= -4.45e-100) {
		tmp = y / (t / x);
	} else if (y <= 9e+113) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (z / (z - t))
	t_2 = x * (y / (t - z))
	tmp = 0
	if y <= -3.5e+84:
		tmp = t_2
	elif y <= -1.1e-80:
		tmp = t_1
	elif y <= -4.45e-100:
		tmp = y / (t / x)
	elif y <= 9e+113:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(z / Float64(z - t)))
	t_2 = Float64(x * Float64(y / Float64(t - z)))
	tmp = 0.0
	if (y <= -3.5e+84)
		tmp = t_2;
	elseif (y <= -1.1e-80)
		tmp = t_1;
	elseif (y <= -4.45e-100)
		tmp = Float64(y / Float64(t / x));
	elseif (y <= 9e+113)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (z / (z - t));
	t_2 = x * (y / (t - z));
	tmp = 0.0;
	if (y <= -3.5e+84)
		tmp = t_2;
	elseif (y <= -1.1e-80)
		tmp = t_1;
	elseif (y <= -4.45e-100)
		tmp = y / (t / x);
	elseif (y <= 9e+113)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e+84], t$95$2, If[LessEqual[y, -1.1e-80], t$95$1, If[LessEqual[y, -4.45e-100], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+113], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{z - t}\\
t_2 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+84}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-80}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 9 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.4999999999999999e84 or 9.0000000000000001e113 < y

    1. Initial program 80.3%

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

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

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

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

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

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

    if -3.4999999999999999e84 < y < -1.10000000000000005e-80 or -4.4500000000000002e-100 < y < 9.0000000000000001e113

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.10000000000000005e-80 < y < -4.4500000000000002e-100

    1. Initial program 99.8%

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
    6. Step-by-step derivation
      1. *-commutative99.8%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
      2. associate-/l*99.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+84}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-80}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;y \leq -4.45 \cdot 10^{-100}:\\ \;\;\;\;\frac{y}{\frac{t}{x}}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+113}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.5% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t \leq -6 \cdot 10^{+37}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.1e118 or 7.2e75 < t

    1. Initial program 82.4%

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

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

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

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

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

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

    if -2.1e118 < t < -6.00000000000000043e37

    1. Initial program 72.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.4%

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

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

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

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

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

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

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

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

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

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

    if -6.00000000000000043e37 < t < -1.15e-105

    1. Initial program 83.8%

      \[\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 y around inf 63.7%

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

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

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

    if -1.15e-105 < t < 7.2e75

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.1 \cdot 10^{+118}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \mathbf{elif}\;t \leq -6 \cdot 10^{+37}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;t \leq -1.15 \cdot 10^{-105}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+75}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x}{\frac{t - z}{y}}\\ \mathbf{if}\;y \leq -1.7 \cdot 10^{+87}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-82}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;y \leq -4.45 \cdot 10^{-100}:\\ \;\;\;\;\frac{y}{\frac{t}{x}}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+114}:\\ \;\;\;\;\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 (/ (- t z) y))))
   (if (<= y -1.7e+87)
     t_1
     (if (<= y -2.4e-82)
       (* x (/ z (- z t)))
       (if (<= y -4.45e-100)
         (/ y (/ t x))
         (if (<= y 5.6e+114) (/ x (- 1.0 (/ t z))) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x / ((t - z) / y);
	double tmp;
	if (y <= -1.7e+87) {
		tmp = t_1;
	} else if (y <= -2.4e-82) {
		tmp = x * (z / (z - t));
	} else if (y <= -4.45e-100) {
		tmp = y / (t / x);
	} else if (y <= 5.6e+114) {
		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 / ((t - z) / y)
    if (y <= (-1.7d+87)) then
        tmp = t_1
    else if (y <= (-2.4d-82)) then
        tmp = x * (z / (z - t))
    else if (y <= (-4.45d-100)) then
        tmp = y / (t / x)
    else if (y <= 5.6d+114) 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 / ((t - z) / y);
	double tmp;
	if (y <= -1.7e+87) {
		tmp = t_1;
	} else if (y <= -2.4e-82) {
		tmp = x * (z / (z - t));
	} else if (y <= -4.45e-100) {
		tmp = y / (t / x);
	} else if (y <= 5.6e+114) {
		tmp = x / (1.0 - (t / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x / ((t - z) / y)
	tmp = 0
	if y <= -1.7e+87:
		tmp = t_1
	elif y <= -2.4e-82:
		tmp = x * (z / (z - t))
	elif y <= -4.45e-100:
		tmp = y / (t / x)
	elif y <= 5.6e+114:
		tmp = x / (1.0 - (t / z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x / Float64(Float64(t - z) / y))
	tmp = 0.0
	if (y <= -1.7e+87)
		tmp = t_1;
	elseif (y <= -2.4e-82)
		tmp = Float64(x * Float64(z / Float64(z - t)));
	elseif (y <= -4.45e-100)
		tmp = Float64(y / Float64(t / x));
	elseif (y <= 5.6e+114)
		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 / ((t - z) / y);
	tmp = 0.0;
	if (y <= -1.7e+87)
		tmp = t_1;
	elseif (y <= -2.4e-82)
		tmp = x * (z / (z - t));
	elseif (y <= -4.45e-100)
		tmp = y / (t / x);
	elseif (y <= 5.6e+114)
		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[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e+87], t$95$1, If[LessEqual[y, -2.4e-82], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.45e-100], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e+114], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;y \leq 5.6 \cdot 10^{+114}:\\
\;\;\;\;\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.7000000000000001e87 or 5.6000000000000001e114 < y

    1. Initial program 80.3%

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

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

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

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

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

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

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

    if -1.7000000000000001e87 < y < -2.40000000000000008e-82

    1. Initial program 93.9%

      \[\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. Taylor expanded in y around 0 55.5%

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

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

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

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

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

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

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

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

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

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

    if -2.40000000000000008e-82 < y < -4.4500000000000002e-100

    1. Initial program 99.8%

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
    6. Step-by-step derivation
      1. *-commutative99.8%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
      2. associate-/l*99.6%

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

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

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

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

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

    if -4.4500000000000002e-100 < y < 5.6000000000000001e114

    1. Initial program 81.1%

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

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

      \[\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-inv96.2%

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

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

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

        \[\leadsto \frac{x}{\color{blue}{-\frac{t - z}{z}}} \]
      2. div-sub80.3%

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

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

        \[\leadsto \frac{x}{-\left(\frac{t}{z} + \left(-\color{blue}{1}\right)\right)} \]
      5. metadata-eval80.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+87}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y}}\\ \mathbf{elif}\;y \leq -2.4 \cdot 10^{-82}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;y \leq -4.45 \cdot 10^{-100}:\\ \;\;\;\;\frac{y}{\frac{t}{x}}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+114}:\\ \;\;\;\;\frac{x}{1 - \frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 59.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+43}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -250000000 \lor \neg \left(z \leq -7.8 \cdot 10^{-91}\right) \land z \leq 52000000000:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -7.2e+43)
   x
   (if (or (<= z -250000000.0)
           (and (not (<= z -7.8e-91)) (<= z 52000000000.0)))
     (* x (/ y t))
     x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -7.2e+43) {
		tmp = x;
	} else if ((z <= -250000000.0) || (!(z <= -7.8e-91) && (z <= 52000000000.0))) {
		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 <= (-7.2d+43)) then
        tmp = x
    else if ((z <= (-250000000.0d0)) .or. (.not. (z <= (-7.8d-91))) .and. (z <= 52000000000.0d0)) 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 <= -7.2e+43) {
		tmp = x;
	} else if ((z <= -250000000.0) || (!(z <= -7.8e-91) && (z <= 52000000000.0))) {
		tmp = x * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -7.2e+43:
		tmp = x
	elif (z <= -250000000.0) or (not (z <= -7.8e-91) and (z <= 52000000000.0)):
		tmp = x * (y / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -7.2e+43)
		tmp = x;
	elseif ((z <= -250000000.0) || (!(z <= -7.8e-91) && (z <= 52000000000.0)))
		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 <= -7.2e+43)
		tmp = x;
	elseif ((z <= -250000000.0) || (~((z <= -7.8e-91)) && (z <= 52000000000.0)))
		tmp = x * (y / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.2e+43], x, If[Or[LessEqual[z, -250000000.0], And[N[Not[LessEqual[z, -7.8e-91]], $MachinePrecision], LessEqual[z, 52000000000.0]]], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -250000000 \lor \neg \left(z \leq -7.8 \cdot 10^{-91}\right) \land z \leq 52000000000:\\
\;\;\;\;x \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.2000000000000002e43 or -2.5e8 < z < -7.79999999999999987e-91 or 5.2e10 < z

    1. Initial program 74.3%

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

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

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

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

    if -7.2000000000000002e43 < z < -2.5e8 or -7.79999999999999987e-91 < z < 5.2e10

    1. Initial program 93.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+43}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -250000000 \lor \neg \left(z \leq -7.8 \cdot 10^{-91}\right) \land z \leq 52000000000:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+49}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -200000000 \lor \neg \left(z \leq -8.8 \cdot 10^{-91}\right) \land z \leq 45000000000:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -5.5e+49)
   x
   (if (or (<= z -200000000.0)
           (and (not (<= z -8.8e-91)) (<= z 45000000000.0)))
     (/ x (/ t y))
     x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -5.5e+49) {
		tmp = x;
	} else if ((z <= -200000000.0) || (!(z <= -8.8e-91) && (z <= 45000000000.0))) {
		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 <= (-5.5d+49)) then
        tmp = x
    else if ((z <= (-200000000.0d0)) .or. (.not. (z <= (-8.8d-91))) .and. (z <= 45000000000.0d0)) 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 <= -5.5e+49) {
		tmp = x;
	} else if ((z <= -200000000.0) || (!(z <= -8.8e-91) && (z <= 45000000000.0))) {
		tmp = x / (t / y);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -5.5e+49:
		tmp = x
	elif (z <= -200000000.0) or (not (z <= -8.8e-91) and (z <= 45000000000.0)):
		tmp = x / (t / y)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -5.5e+49)
		tmp = x;
	elseif ((z <= -200000000.0) || (!(z <= -8.8e-91) && (z <= 45000000000.0)))
		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 <= -5.5e+49)
		tmp = x;
	elseif ((z <= -200000000.0) || (~((z <= -8.8e-91)) && (z <= 45000000000.0)))
		tmp = x / (t / y);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.5e+49], x, If[Or[LessEqual[z, -200000000.0], And[N[Not[LessEqual[z, -8.8e-91]], $MachinePrecision], LessEqual[z, 45000000000.0]]], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -200000000 \lor \neg \left(z \leq -8.8 \cdot 10^{-91}\right) \land z \leq 45000000000:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.50000000000000042e49 or -2e8 < z < -8.8000000000000003e-91 or 4.5e10 < z

    1. Initial program 74.3%

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

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

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

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

    if -5.50000000000000042e49 < z < -2e8 or -8.8000000000000003e-91 < z < 4.5e10

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

Alternative 8: 60.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -55:\\
\;\;\;\;x \cdot \frac{-z}{t}\\

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

\mathbf{elif}\;z \leq 2050000000:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.00000000000000003e78 or 2.05e9 < z

    1. Initial program 67.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.5%

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

    if -4.00000000000000003e78 < z < -55

    1. Initial program 95.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 inf 58.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{t}} \]
    9. Step-by-step derivation
      1. mul-1-neg40.7%

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{z}{-t}} \]
    10. Simplified40.5%

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

    if -55 < z < -8.8000000000000003e-91

    1. Initial program 99.8%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot y}{z}} \]
      2. neg-mul-141.3%

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

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

    if -8.8000000000000003e-91 < z < 2.05e9

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

Alternative 9: 60.4% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq 12500000000:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.2000000000000005e48 or 1.25e10 < 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 z around inf 59.2%

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

    if -8.2000000000000005e48 < z < -8.8000000000000003e-91

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

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

    if -8.8000000000000003e-91 < z < 1.25e10

    1. Initial program 93.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+48}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-91}:\\ \;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;z \leq 12500000000:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 69.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{-98} \lor \neg \left(z \leq 210000000\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.05e-98) (not (<= z 210000000.0)))
   (* x (- 1.0 (/ y z)))
   (/ x (/ t y))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.05e-98) || !(z <= 210000000.0)) {
		tmp = x * (1.0 - (y / z));
	} else {
		tmp = x / (t / y);
	}
	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 <= (-1.05d-98)) .or. (.not. (z <= 210000000.0d0))) then
        tmp = x * (1.0d0 - (y / z))
    else
        tmp = x / (t / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.05e-98) || !(z <= 210000000.0)) {
		tmp = x * (1.0 - (y / z));
	} else {
		tmp = x / (t / y);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.05e-98) or not (z <= 210000000.0):
		tmp = x * (1.0 - (y / z))
	else:
		tmp = x / (t / y)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.05e-98) || !(z <= 210000000.0))
		tmp = Float64(x * Float64(1.0 - Float64(y / z)));
	else
		tmp = Float64(x / Float64(t / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1.05e-98) || ~((z <= 210000000.0)))
		tmp = x * (1.0 - (y / z));
	else
		tmp = x / (t / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.05e-98], N[Not[LessEqual[z, 210000000.0]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-98} \lor \neg \left(z \leq 210000000\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.04999999999999996e-98 or 2.1e8 < z

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.04999999999999996e-98 < z < 2.1e8

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

Alternative 11: 96.9% 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 82.9%

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

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

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

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

Alternative 12: 34.8% 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 82.9%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification34.3%

    \[\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 2024082 
(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)))