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

Percentage Accurate: 84.0% → 97.2%
Time: 8.7s
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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 97.2% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 5.1 \cdot 10^{-11}:\\ \;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{z - y}{\frac{z - t}{x\_m}}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= x_m 5.1e-11)
    (/ (* x_m (- y z)) (- t z))
    (/ (- z y) (/ (- z t) x_m)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (x_m <= 5.1e-11) {
		tmp = (x_m * (y - z)) / (t - z);
	} else {
		tmp = (z - y) / ((z - t) / x_m);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x_m <= 5.1d-11) then
        tmp = (x_m * (y - z)) / (t - z)
    else
        tmp = (z - y) / ((z - t) / x_m)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (x_m <= 5.1e-11) {
		tmp = (x_m * (y - z)) / (t - z);
	} else {
		tmp = (z - y) / ((z - t) / x_m);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if x_m <= 5.1e-11:
		tmp = (x_m * (y - z)) / (t - z)
	else:
		tmp = (z - y) / ((z - t) / x_m)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (x_m <= 5.1e-11)
		tmp = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z));
	else
		tmp = Float64(Float64(z - y) / Float64(Float64(z - t) / x_m));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (x_m <= 5.1e-11)
		tmp = (x_m * (y - z)) / (t - z);
	else
		tmp = (z - y) / ((z - t) / x_m);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 5.1e-11], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(z - y), $MachinePrecision] / N[(N[(z - t), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 5.1 \cdot 10^{-11}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5.09999999999999984e-11

    1. Initial program 88.8%

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

    if 5.09999999999999984e-11 < x

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot \left(z - y\right)}{z - t}} \]
    9. Step-by-step derivation
      1. *-commutative73.0%

        \[\leadsto \frac{\color{blue}{\left(z - y\right) \cdot x}}{z - t} \]
      2. *-rgt-identity73.0%

        \[\leadsto \frac{\left(z - y\right) \cdot x}{\color{blue}{\left(z - t\right) \cdot 1}} \]
      3. times-frac95.5%

        \[\leadsto \color{blue}{\frac{z - y}{z - t} \cdot \frac{x}{1}} \]
      4. /-rgt-identity95.5%

        \[\leadsto \frac{z - y}{z - t} \cdot \color{blue}{x} \]
      5. associate-/r/98.4%

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

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

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

Alternative 2: 72.1% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := x\_m \cdot \left(1 - \frac{y}{z}\right)\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.56 \cdot 10^{+178}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{+71}:\\ \;\;\;\;z \cdot \frac{x\_m}{z - t}\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-56}:\\ \;\;\;\;x\_m \cdot \frac{y}{t - z}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+40}:\\ \;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (* x_m (- 1.0 (/ y z)))))
   (*
    x_s
    (if (<= z -1.56e+178)
      t_1
      (if (<= z -2.9e+71)
        (* z (/ x_m (- z t)))
        (if (<= z -4.2e-56)
          (* x_m (/ y (- t z)))
          (if (<= z 1.45e+40) (/ (* x_m (- y z)) t) t_1)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m * (1.0 - (y / z));
	double tmp;
	if (z <= -1.56e+178) {
		tmp = t_1;
	} else if (z <= -2.9e+71) {
		tmp = z * (x_m / (z - t));
	} else if (z <= -4.2e-56) {
		tmp = x_m * (y / (t - z));
	} else if (z <= 1.45e+40) {
		tmp = (x_m * (y - z)) / t;
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m * (1.0d0 - (y / z))
    if (z <= (-1.56d+178)) then
        tmp = t_1
    else if (z <= (-2.9d+71)) then
        tmp = z * (x_m / (z - t))
    else if (z <= (-4.2d-56)) then
        tmp = x_m * (y / (t - z))
    else if (z <= 1.45d+40) then
        tmp = (x_m * (y - z)) / t
    else
        tmp = t_1
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m * (1.0 - (y / z));
	double tmp;
	if (z <= -1.56e+178) {
		tmp = t_1;
	} else if (z <= -2.9e+71) {
		tmp = z * (x_m / (z - t));
	} else if (z <= -4.2e-56) {
		tmp = x_m * (y / (t - z));
	} else if (z <= 1.45e+40) {
		tmp = (x_m * (y - z)) / t;
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	t_1 = x_m * (1.0 - (y / z))
	tmp = 0
	if z <= -1.56e+178:
		tmp = t_1
	elif z <= -2.9e+71:
		tmp = z * (x_m / (z - t))
	elif z <= -4.2e-56:
		tmp = x_m * (y / (t - z))
	elif z <= 1.45e+40:
		tmp = (x_m * (y - z)) / t
	else:
		tmp = t_1
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m * Float64(1.0 - Float64(y / z)))
	tmp = 0.0
	if (z <= -1.56e+178)
		tmp = t_1;
	elseif (z <= -2.9e+71)
		tmp = Float64(z * Float64(x_m / Float64(z - t)));
	elseif (z <= -4.2e-56)
		tmp = Float64(x_m * Float64(y / Float64(t - z)));
	elseif (z <= 1.45e+40)
		tmp = Float64(Float64(x_m * Float64(y - z)) / t);
	else
		tmp = t_1;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m * (1.0 - (y / z));
	tmp = 0.0;
	if (z <= -1.56e+178)
		tmp = t_1;
	elseif (z <= -2.9e+71)
		tmp = z * (x_m / (z - t));
	elseif (z <= -4.2e-56)
		tmp = x_m * (y / (t - z));
	elseif (z <= 1.45e+40)
		tmp = (x_m * (y - z)) / t;
	else
		tmp = t_1;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.56e+178], t$95$1, If[LessEqual[z, -2.9e+71], N[(z * N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-56], N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+40], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

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

\mathbf{elif}\;z \leq -2.9 \cdot 10^{+71}:\\
\;\;\;\;z \cdot \frac{x\_m}{z - t}\\

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

\mathbf{elif}\;z \leq 1.45 \cdot 10^{+40}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.56e178 or 1.45000000000000009e40 < z

    1. Initial program 66.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.56e178 < z < -2.90000000000000007e71

    1. Initial program 74.7%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. remove-double-neg74.7%

        \[\leadsto \frac{\color{blue}{-\left(-x \cdot \left(y - z\right)\right)}}{t - z} \]
      2. distribute-lft-neg-out74.7%

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot \left(y - z\right)}}{-\left(t - z\right)} \]
      6. distribute-rgt-neg-in74.7%

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \left(z - y\right)}{-\color{blue}{\left(t + \left(-z\right)\right)}} \]
      13. distribute-neg-in74.7%

        \[\leadsto \frac{x \cdot \left(z - y\right)}{\color{blue}{\left(-t\right) + \left(-\left(-z\right)\right)}} \]
      14. remove-double-neg74.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{x}{z - t}} \]
    7. Applied egg-rr78.4%

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

    if -2.90000000000000007e71 < z < -4.20000000000000012e-56

    1. Initial program 91.2%

      \[\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 inf 65.7%

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

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

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

    if -4.20000000000000012e-56 < z < 1.45000000000000009e40

    1. Initial program 97.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.56 \cdot 10^{+178}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{+71}:\\ \;\;\;\;z \cdot \frac{x}{z - t}\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-56}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+40}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 69.0% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{-56} \lor \neg \left(z \leq 3.45 \cdot 10^{-15}\right):\\ \;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m \cdot y}{t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -7.2e-56) (not (<= z 3.45e-15)))
    (* x_m (- 1.0 (/ y z)))
    (/ (* x_m y) t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -7.2e-56) || !(z <= 3.45e-15)) {
		tmp = x_m * (1.0 - (y / z));
	} else {
		tmp = (x_m * y) / t;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-7.2d-56)) .or. (.not. (z <= 3.45d-15))) then
        tmp = x_m * (1.0d0 - (y / z))
    else
        tmp = (x_m * y) / t
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -7.2e-56) || !(z <= 3.45e-15)) {
		tmp = x_m * (1.0 - (y / z));
	} else {
		tmp = (x_m * y) / t;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -7.2e-56) or not (z <= 3.45e-15):
		tmp = x_m * (1.0 - (y / z))
	else:
		tmp = (x_m * y) / t
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -7.2e-56) || !(z <= 3.45e-15))
		tmp = Float64(x_m * Float64(1.0 - Float64(y / z)));
	else
		tmp = Float64(Float64(x_m * y) / t);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -7.2e-56) || ~((z <= 3.45e-15)))
		tmp = x_m * (1.0 - (y / z));
	else
		tmp = (x_m * y) / t;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -7.2e-56], N[Not[LessEqual[z, 3.45e-15]], $MachinePrecision]], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m * y), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-56} \lor \neg \left(z \leq 3.45 \cdot 10^{-15}\right):\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.19999999999999956e-56 or 3.45000000000000005e-15 < z

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999956e-56 < z < 3.45000000000000005e-15

    1. Initial program 97.1%

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

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

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

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

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

Alternative 4: 75.3% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+71} \lor \neg \left(z \leq 1.95 \cdot 10^{-12}\right):\\ \;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \frac{y}{t - z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -3.5e+71) (not (<= z 1.95e-12)))
    (* x_m (- 1.0 (/ y z)))
    (* x_m (/ y (- t z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -3.5e+71) || !(z <= 1.95e-12)) {
		tmp = x_m * (1.0 - (y / z));
	} else {
		tmp = x_m * (y / (t - z));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-3.5d+71)) .or. (.not. (z <= 1.95d-12))) then
        tmp = x_m * (1.0d0 - (y / z))
    else
        tmp = x_m * (y / (t - z))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -3.5e+71) || !(z <= 1.95e-12)) {
		tmp = x_m * (1.0 - (y / z));
	} else {
		tmp = x_m * (y / (t - z));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -3.5e+71) or not (z <= 1.95e-12):
		tmp = x_m * (1.0 - (y / z))
	else:
		tmp = x_m * (y / (t - z))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -3.5e+71) || !(z <= 1.95e-12))
		tmp = Float64(x_m * Float64(1.0 - Float64(y / z)));
	else
		tmp = Float64(x_m * Float64(y / Float64(t - z)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -3.5e+71) || ~((z <= 1.95e-12)))
		tmp = x_m * (1.0 - (y / z));
	else
		tmp = x_m * (y / (t - z));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -3.5e+71], N[Not[LessEqual[z, 1.95e-12]], $MachinePrecision]], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+71} \lor \neg \left(z \leq 1.95 \cdot 10^{-12}\right):\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.4999999999999999e71 or 1.94999999999999997e-12 < z

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4999999999999999e71 < z < 1.94999999999999997e-12

    1. Initial program 96.2%

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

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

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

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

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

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

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

Alternative 5: 74.2% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -3.1 \cdot 10^{-35} \lor \neg \left(t \leq 980000000000\right):\\ \;\;\;\;x\_m \cdot \frac{y - z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= t -3.1e-35) (not (<= t 980000000000.0)))
    (* x_m (/ (- y z) t))
    (* x_m (- 1.0 (/ y z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((t <= -3.1e-35) || !(t <= 980000000000.0)) {
		tmp = x_m * ((y - z) / t);
	} else {
		tmp = x_m * (1.0 - (y / z));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((t <= (-3.1d-35)) .or. (.not. (t <= 980000000000.0d0))) then
        tmp = x_m * ((y - z) / t)
    else
        tmp = x_m * (1.0d0 - (y / z))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((t <= -3.1e-35) || !(t <= 980000000000.0)) {
		tmp = x_m * ((y - z) / t);
	} else {
		tmp = x_m * (1.0 - (y / z));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (t <= -3.1e-35) or not (t <= 980000000000.0):
		tmp = x_m * ((y - z) / t)
	else:
		tmp = x_m * (1.0 - (y / z))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((t <= -3.1e-35) || !(t <= 980000000000.0))
		tmp = Float64(x_m * Float64(Float64(y - z) / t));
	else
		tmp = Float64(x_m * Float64(1.0 - Float64(y / z)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((t <= -3.1e-35) || ~((t <= 980000000000.0)))
		tmp = x_m * ((y - z) / t);
	else
		tmp = x_m * (1.0 - (y / z));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[t, -3.1e-35], N[Not[LessEqual[t, 980000000000.0]], $MachinePrecision]], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-35} \lor \neg \left(t \leq 980000000000\right):\\
\;\;\;\;x\_m \cdot \frac{y - z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.10000000000000012e-35 or 9.8e11 < t

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

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

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

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

    if -3.10000000000000012e-35 < t < 9.8e11

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 74.2% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{-31}:\\ \;\;\;\;x\_m \cdot \frac{y - z}{t}\\ \mathbf{elif}\;t \leq 4000000000000:\\ \;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{\frac{t}{y - z}}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= t -6.8e-31)
    (* x_m (/ (- y z) t))
    (if (<= t 4000000000000.0)
      (* x_m (- 1.0 (/ y z)))
      (/ x_m (/ t (- y z)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -6.8e-31) {
		tmp = x_m * ((y - z) / t);
	} else if (t <= 4000000000000.0) {
		tmp = x_m * (1.0 - (y / z));
	} else {
		tmp = x_m / (t / (y - z));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-6.8d-31)) then
        tmp = x_m * ((y - z) / t)
    else if (t <= 4000000000000.0d0) then
        tmp = x_m * (1.0d0 - (y / z))
    else
        tmp = x_m / (t / (y - z))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (t <= -6.8e-31) {
		tmp = x_m * ((y - z) / t);
	} else if (t <= 4000000000000.0) {
		tmp = x_m * (1.0 - (y / z));
	} else {
		tmp = x_m / (t / (y - z));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if t <= -6.8e-31:
		tmp = x_m * ((y - z) / t)
	elif t <= 4000000000000.0:
		tmp = x_m * (1.0 - (y / z))
	else:
		tmp = x_m / (t / (y - z))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (t <= -6.8e-31)
		tmp = Float64(x_m * Float64(Float64(y - z) / t));
	elseif (t <= 4000000000000.0)
		tmp = Float64(x_m * Float64(1.0 - Float64(y / z)));
	else
		tmp = Float64(x_m / Float64(t / Float64(y - z)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (t <= -6.8e-31)
		tmp = x_m * ((y - z) / t);
	elseif (t <= 4000000000000.0)
		tmp = x_m * (1.0 - (y / z));
	else
		tmp = x_m / (t / (y - z));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[t, -6.8e-31], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4000000000000.0], N[(x$95$m * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{-31}:\\
\;\;\;\;x\_m \cdot \frac{y - z}{t}\\

\mathbf{elif}\;t \leq 4000000000000:\\
\;\;\;\;x\_m \cdot \left(1 - \frac{y}{z}\right)\\

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


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

    1. Initial program 81.4%

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

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

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

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

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

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

    if -6.8000000000000002e-31 < t < 4e12

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4e12 < t

    1. Initial program 85.3%

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

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

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

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

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

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

Alternative 7: 60.8% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+67}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq 1.22 \cdot 10^{-11}:\\ \;\;\;\;x\_m \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (* x_s (if (<= z -8e+67) x_m (if (<= z 1.22e-11) (* x_m (/ y t)) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -8e+67) {
		tmp = x_m;
	} else if (z <= 1.22e-11) {
		tmp = x_m * (y / t);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-8d+67)) then
        tmp = x_m
    else if (z <= 1.22d-11) then
        tmp = x_m * (y / t)
    else
        tmp = x_m
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -8e+67) {
		tmp = x_m;
	} else if (z <= 1.22e-11) {
		tmp = x_m * (y / t);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= -8e+67:
		tmp = x_m
	elif z <= 1.22e-11:
		tmp = x_m * (y / t)
	else:
		tmp = x_m
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= -8e+67)
		tmp = x_m;
	elseif (z <= 1.22e-11)
		tmp = Float64(x_m * Float64(y / t));
	else
		tmp = x_m;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= -8e+67)
		tmp = x_m;
	elseif (z <= 1.22e-11)
		tmp = x_m * (y / t);
	else
		tmp = x_m;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -8e+67], x$95$m, If[LessEqual[z, 1.22e-11], N[(x$95$m * N[(y / t), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+67}:\\
\;\;\;\;x\_m\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.99999999999999986e67 or 1.2200000000000001e-11 < z

    1. Initial program 70.9%

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

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

    if -7.99999999999999986e67 < z < 1.2200000000000001e-11

    1. Initial program 96.2%

      \[\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 z around 0 65.9%

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

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

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

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

Alternative 8: 60.0% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+68}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-13}:\\ \;\;\;\;y \cdot \frac{x\_m}{t}\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (* x_s (if (<= z -2.8e+68) x_m (if (<= z 5.5e-13) (* y (/ x_m t)) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -2.8e+68) {
		tmp = x_m;
	} else if (z <= 5.5e-13) {
		tmp = y * (x_m / t);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-2.8d+68)) then
        tmp = x_m
    else if (z <= 5.5d-13) then
        tmp = y * (x_m / t)
    else
        tmp = x_m
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -2.8e+68) {
		tmp = x_m;
	} else if (z <= 5.5e-13) {
		tmp = y * (x_m / t);
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= -2.8e+68:
		tmp = x_m
	elif z <= 5.5e-13:
		tmp = y * (x_m / t)
	else:
		tmp = x_m
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= -2.8e+68)
		tmp = x_m;
	elseif (z <= 5.5e-13)
		tmp = Float64(y * Float64(x_m / t));
	else
		tmp = x_m;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= -2.8e+68)
		tmp = x_m;
	elseif (z <= 5.5e-13)
		tmp = y * (x_m / t);
	else
		tmp = x_m;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -2.8e+68], x$95$m, If[LessEqual[z, 5.5e-13], N[(y * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+68}:\\
\;\;\;\;x\_m\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.8e68 or 5.49999999999999979e-13 < z

    1. Initial program 70.9%

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

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

    if -2.8e68 < z < 5.49999999999999979e-13

    1. Initial program 96.2%

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

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

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

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

      \[\leadsto \frac{x}{\color{blue}{\frac{t}{y}}} \]
    8. Step-by-step derivation
      1. associate-/r/64.7%

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

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

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

Alternative 9: 59.5% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+69}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{x\_m \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (* x_s (if (<= z -1.2e+69) x_m (if (<= z 6.5e-12) (/ (* x_m y) t) x_m))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -1.2e+69) {
		tmp = x_m;
	} else if (z <= 6.5e-12) {
		tmp = (x_m * y) / t;
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-1.2d+69)) then
        tmp = x_m
    else if (z <= 6.5d-12) then
        tmp = (x_m * y) / t
    else
        tmp = x_m
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -1.2e+69) {
		tmp = x_m;
	} else if (z <= 6.5e-12) {
		tmp = (x_m * y) / t;
	} else {
		tmp = x_m;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= -1.2e+69:
		tmp = x_m
	elif z <= 6.5e-12:
		tmp = (x_m * y) / t
	else:
		tmp = x_m
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= -1.2e+69)
		tmp = x_m;
	elseif (z <= 6.5e-12)
		tmp = Float64(Float64(x_m * y) / t);
	else
		tmp = x_m;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= -1.2e+69)
		tmp = x_m;
	elseif (z <= 6.5e-12)
		tmp = (x_m * y) / t;
	else
		tmp = x_m;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.2e+69], x$95$m, If[LessEqual[z, 6.5e-12], N[(N[(x$95$m * y), $MachinePrecision] / t), $MachinePrecision], x$95$m]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+69}:\\
\;\;\;\;x\_m\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2000000000000001e69 or 6.5000000000000002e-12 < z

    1. Initial program 70.9%

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

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

    if -1.2000000000000001e69 < z < 6.5000000000000002e-12

    1. Initial program 96.2%

      \[\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 z around 0 65.9%

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

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

Alternative 10: 97.0% accurate, 0.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 5000000000000:\\ \;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\left(z - y\right) \cdot \frac{x\_m}{z - t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= x_m 5000000000000.0)
    (/ (* x_m (- y z)) (- t z))
    (* (- z y) (/ x_m (- z t))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (x_m <= 5000000000000.0) {
		tmp = (x_m * (y - z)) / (t - z);
	} else {
		tmp = (z - y) * (x_m / (z - t));
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x_m <= 5000000000000.0d0) then
        tmp = (x_m * (y - z)) / (t - z)
    else
        tmp = (z - y) * (x_m / (z - t))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (x_m <= 5000000000000.0) {
		tmp = (x_m * (y - z)) / (t - z);
	} else {
		tmp = (z - y) * (x_m / (z - t));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if x_m <= 5000000000000.0:
		tmp = (x_m * (y - z)) / (t - z)
	else:
		tmp = (z - y) * (x_m / (z - t))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (x_m <= 5000000000000.0)
		tmp = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z));
	else
		tmp = Float64(Float64(z - y) * Float64(x_m / Float64(z - t)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (x_m <= 5000000000000.0)
		tmp = (x_m * (y - z)) / (t - z);
	else
		tmp = (z - y) * (x_m / (z - t));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 5000000000000.0], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(z - y), $MachinePrecision] * N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 5000000000000:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5e12

    1. Initial program 89.1%

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

    if 5e12 < x

    1. Initial program 70.8%

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
    6. Step-by-step derivation
      1. remove-double-neg70.8%

        \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{-\left(-\left(t - z\right)\right)}} \]
      2. distribute-neg-frac270.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 96.9% accurate, 1.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(x\_m \cdot \frac{y - z}{t - z}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (* x_s (* x_m (/ (- y z) (- t z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m * ((y - z) / (t - z)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x_s * (x_m * ((y - z) / (t - z)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m * ((y - z) / (t - z)));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	return x_s * (x_m * ((y - z) / (t - z)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	return Float64(x_s * Float64(x_m * Float64(Float64(y - z) / Float64(t - z))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z, t)
	tmp = x_s * (x_m * ((y - z) / (t - z)));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \left(x\_m \cdot \frac{y - z}{t - z}\right)
\end{array}
Derivation
  1. Initial program 84.7%

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

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

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

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

Alternative 12: 35.2% accurate, 9.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot x\_m \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t) :precision binary64 (* x_s x_m))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * x_m;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x_s * x_m
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * x_m;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	return x_s * x_m
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	return Float64(x_s * x_m)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z, t)
	tmp = x_s * x_m;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * x$95$m), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot x\_m
\end{array}
Derivation
  1. Initial program 84.7%

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

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

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