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

Percentage Accurate: 84.2% → 96.8%
Time: 9.5s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 84.2% accurate, 1.0× speedup?

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

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

Alternative 1: 96.8% 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 83.2%

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

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

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

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

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

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

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

Alternative 2: 72.5% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t \leq 3.2 \cdot 10^{+81} \lor \neg \left(t \leq 9.4 \cdot 10^{+162}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.1999999999999995e-66 or 2.15000000000000012e-17 < t < 3.2e81 or 9.40000000000000006e162 < t

    1. Initial program 86.2%

      \[\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 t around inf 73.3%

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

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

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

    if -6.1999999999999995e-66 < t < 2.15000000000000012e-17

    1. Initial program 79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2e81 < t < 9.40000000000000006e162

    1. Initial program 81.2%

      \[\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 0 49.3%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.2 \cdot 10^{-66}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \mathbf{elif}\;t \leq 2.15 \cdot 10^{-17}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+81} \lor \neg \left(t \leq 9.4 \cdot 10^{+162}\right):\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 68.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -1.56:\\
\;\;\;\;\frac{x \cdot \left(-z\right)}{t}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.28e54 or 10.5 < z

    1. Initial program 74.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.28e54 < z < -1.5600000000000001

    1. Initial program 99.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 t around inf 77.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot z\right)}{t}} \]
      2. associate-*r*63.2%

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

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

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

    if -1.5600000000000001 < z < -6.6000000000000001e-35

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.6000000000000001e-35 < z < 10.5

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

Alternative 4: 71.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y - z}{t}\\ \mathbf{if}\;t \leq -6.2 \cdot 10^{-66}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-15}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+83}:\\ \;\;\;\;y \cdot \frac{x}{t - z}\\ \mathbf{elif}\;t \leq 5.1 \cdot 10^{+163}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ (- y z) t))))
   (if (<= t -6.2e-66)
     t_1
     (if (<= t 2.7e-15)
       (* x (- 1.0 (/ y z)))
       (if (<= t 4.5e+83)
         (* y (/ x (- t z)))
         (if (<= t 5.1e+163) (* x (/ z (- z t))) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y - z) / t);
	double tmp;
	if (t <= -6.2e-66) {
		tmp = t_1;
	} else if (t <= 2.7e-15) {
		tmp = x * (1.0 - (y / z));
	} else if (t <= 4.5e+83) {
		tmp = y * (x / (t - z));
	} else if (t <= 5.1e+163) {
		tmp = x * (z / (z - t));
	} 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 <= (-6.2d-66)) then
        tmp = t_1
    else if (t <= 2.7d-15) then
        tmp = x * (1.0d0 - (y / z))
    else if (t <= 4.5d+83) then
        tmp = y * (x / (t - z))
    else if (t <= 5.1d+163) then
        tmp = x * (z / (z - t))
    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 <= -6.2e-66) {
		tmp = t_1;
	} else if (t <= 2.7e-15) {
		tmp = x * (1.0 - (y / z));
	} else if (t <= 4.5e+83) {
		tmp = y * (x / (t - z));
	} else if (t <= 5.1e+163) {
		tmp = x * (z / (z - t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y - z) / t)
	tmp = 0
	if t <= -6.2e-66:
		tmp = t_1
	elif t <= 2.7e-15:
		tmp = x * (1.0 - (y / z))
	elif t <= 4.5e+83:
		tmp = y * (x / (t - z))
	elif t <= 5.1e+163:
		tmp = x * (z / (z - t))
	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 <= -6.2e-66)
		tmp = t_1;
	elseif (t <= 2.7e-15)
		tmp = Float64(x * Float64(1.0 - Float64(y / z)));
	elseif (t <= 4.5e+83)
		tmp = Float64(y * Float64(x / Float64(t - z)));
	elseif (t <= 5.1e+163)
		tmp = Float64(x * Float64(z / Float64(z - t)));
	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 <= -6.2e-66)
		tmp = t_1;
	elseif (t <= 2.7e-15)
		tmp = x * (1.0 - (y / z));
	elseif (t <= 4.5e+83)
		tmp = y * (x / (t - z));
	elseif (t <= 5.1e+163)
		tmp = x * (z / (z - t));
	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, -6.2e-66], t$95$1, If[LessEqual[t, 2.7e-15], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+83], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.1e+163], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -6.1999999999999995e-66 or 5.1000000000000002e163 < t

    1. Initial program 85.0%

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

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

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

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

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

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

    if -6.1999999999999995e-66 < t < 2.70000000000000009e-15

    1. Initial program 79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.70000000000000009e-15 < t < 4.4999999999999999e83

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999999e83 < t < 5.1000000000000002e163

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.2 \cdot 10^{-66}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-15}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+83}:\\ \;\;\;\;y \cdot \frac{x}{t - z}\\ \mathbf{elif}\;t \leq 5.1 \cdot 10^{+163}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.8% accurate, 0.3× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.8e-67 or 1.9200000000000001e161 < t

    1. Initial program 85.0%

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

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

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

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

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

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

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

    if -4.8e-67 < t < 4.7999999999999999e-15

    1. Initial program 79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.7999999999999999e-15 < t < 5.4999999999999996e83

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

    if 5.4999999999999996e83 < t < 1.9200000000000001e161

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.8 \cdot 10^{-67}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z}}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-15}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{+83}:\\ \;\;\;\;y \cdot \frac{x}{t - z}\\ \mathbf{elif}\;t \leq 1.92 \cdot 10^{+161}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t}{y - z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 60.4% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.14999999999999994e117 or 3.59999999999999994e-7 < z

    1. Initial program 72.5%

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

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

    if -1.14999999999999994e117 < z < -2.05e-11

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.05e-11 < z < -1.00000000000000003e-53

    1. Initial program 83.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 66.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000003e-53 < z < 3.59999999999999994e-7

    1. Initial program 89.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+117}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -2.05 \cdot 10^{-11}:\\ \;\;\;\;x \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-53}:\\ \;\;\;\;x \cdot \frac{y}{-z}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-7}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 60.6% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.09999999999999996e116 or 7.49999999999999934e-5 < z

    1. Initial program 72.5%

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

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

    if -3.09999999999999996e116 < z < -8.9999999999999995e-14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.9999999999999995e-14 < z < -1.10000000000000005e-52

    1. Initial program 83.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 66.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.10000000000000005e-52 < z < 7.49999999999999934e-5

    1. Initial program 89.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+116}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-14}:\\ \;\;\;\;x \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-52}:\\ \;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-5}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 60.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-16}:\\
\;\;\;\;\frac{x \cdot \left(-z\right)}{t}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.49999999999999997e116 or 3.90000000000000025e-7 < z

    1. Initial program 72.5%

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

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

    if -3.49999999999999997e116 < z < -1.15e-16

    1. Initial program 99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(x \cdot z\right)}{t}} \]
      2. associate-*r*48.2%

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

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

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

    if -1.15e-16 < z < -3.0000000000000002e-53

    1. Initial program 83.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 66.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.0000000000000002e-53 < z < 3.90000000000000025e-7

    1. Initial program 89.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+116}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-16}:\\ \;\;\;\;\frac{x \cdot \left(-z\right)}{t}\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-53}:\\ \;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{-7}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 70.2% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 72.3%

      \[\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 y around 0 55.6%

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

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

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

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

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

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

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

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

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

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

    if -1.1e-26 < z < 5

    1. Initial program 89.7%

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

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

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

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

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

    if 5 < z

    1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 62.1% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.06e19 or 0.0560000000000000012 < z

    1. Initial program 76.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 60.9%

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

    if -1.06e19 < z < 0.0560000000000000012

    1. Initial program 90.1%

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

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

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

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

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

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

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

Alternative 11: 62.1% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.35e17 or 0.0560000000000000012 < z

    1. Initial program 76.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 60.9%

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

    if -1.35e17 < z < 0.0560000000000000012

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 35.1% 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 83.2%

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

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

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

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

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 96.8% 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 2024079 
(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)))