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

Percentage Accurate: 84.0% → 96.9%
Time: 9.4s
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: 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 85.2%

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

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

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

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

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

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

Alternative 2: 74.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+31} \lor \neg \left(z \leq -1.02 \cdot 10^{-72}\right) \land \left(z \leq -1.2 \cdot 10^{-90} \lor \neg \left(z \leq 5800000000\right)\right):\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.2000000000000003e31 or -1.02e-72 < z < -1.2000000000000001e-90 or 5.8e9 < z

    1. Initial program 77.0%

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

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

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      3. *-commutative99.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 y around 0 63.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-x}{\frac{t - z}{z}}} \]
      4. div-sub83.8%

        \[\leadsto \frac{-x}{\color{blue}{\frac{t}{z} - \frac{z}{z}}} \]
      5. *-inverses83.8%

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

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

        \[\leadsto \color{blue}{\frac{-\left(-x\right)}{-\left(\frac{t}{z} - 1\right)}} \]
      2. div-inv83.7%

        \[\leadsto \color{blue}{\left(-\left(-x\right)\right) \cdot \frac{1}{-\left(\frac{t}{z} - 1\right)}} \]
      3. remove-double-neg83.7%

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\left(-\frac{t}{z}\right) + \color{blue}{1}} \]
    9. Applied egg-rr83.7%

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

        \[\leadsto \color{blue}{\frac{x \cdot 1}{\left(-\frac{t}{z}\right) + 1}} \]
      2. *-rgt-identity83.8%

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

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

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

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

    if -8.2000000000000003e31 < z < -1.02e-72 or -1.2000000000000001e-90 < z < 5.8e9

    1. Initial program 92.8%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{t - z}} \]
    6. 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}} \]
    7. Simplified82.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+31} \lor \neg \left(z \leq -1.02 \cdot 10^{-72}\right) \land \left(z \leq -1.2 \cdot 10^{-90} \lor \neg \left(z \leq 5800000000\right)\right):\\ \;\;\;\;\frac{x}{1 - \frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{t - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y - z}{t}\\ \mathbf{if}\;z \leq -9.5 \cdot 10^{+83}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 7.5:\\ \;\;\;\;y \cdot \left(-\frac{x}{z}\right)\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+76}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ (- y z) t))))
   (if (<= z -9.5e+83)
     x
     (if (<= z 1.1e-46)
       t_1
       (if (<= z 7.5) (* y (- (/ x z))) (if (<= z 3.5e+76) t_1 x))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y - z) / t);
	double tmp;
	if (z <= -9.5e+83) {
		tmp = x;
	} else if (z <= 1.1e-46) {
		tmp = t_1;
	} else if (z <= 7.5) {
		tmp = y * -(x / z);
	} else if (z <= 3.5e+76) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x * ((y - z) / t)
    if (z <= (-9.5d+83)) then
        tmp = x
    else if (z <= 1.1d-46) then
        tmp = t_1
    else if (z <= 7.5d0) then
        tmp = y * -(x / z)
    else if (z <= 3.5d+76) then
        tmp = t_1
    else
        tmp = x
    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 (z <= -9.5e+83) {
		tmp = x;
	} else if (z <= 1.1e-46) {
		tmp = t_1;
	} else if (z <= 7.5) {
		tmp = y * -(x / z);
	} else if (z <= 3.5e+76) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y - z) / t)
	tmp = 0
	if z <= -9.5e+83:
		tmp = x
	elif z <= 1.1e-46:
		tmp = t_1
	elif z <= 7.5:
		tmp = y * -(x / z)
	elif z <= 3.5e+76:
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y - z) / t))
	tmp = 0.0
	if (z <= -9.5e+83)
		tmp = x;
	elseif (z <= 1.1e-46)
		tmp = t_1;
	elseif (z <= 7.5)
		tmp = Float64(y * Float64(-Float64(x / z)));
	elseif (z <= 3.5e+76)
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y - z) / t);
	tmp = 0.0;
	if (z <= -9.5e+83)
		tmp = x;
	elseif (z <= 1.1e-46)
		tmp = t_1;
	elseif (z <= 7.5)
		tmp = y * -(x / z);
	elseif (z <= 3.5e+76)
		tmp = t_1;
	else
		tmp = x;
	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[z, -9.5e+83], x, If[LessEqual[z, 1.1e-46], t$95$1, If[LessEqual[z, 7.5], N[(y * (-N[(x / z), $MachinePrecision])), $MachinePrecision], If[LessEqual[z, 3.5e+76], t$95$1, x]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 1.1 \cdot 10^{-46}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 3.5 \cdot 10^{+76}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.5000000000000002e83 or 3.5e76 < z

    1. Initial program 72.9%

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

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

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

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

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

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

    if -9.5000000000000002e83 < z < 1.1e-46 or 7.5 < z < 3.5e76

    1. Initial program 91.8%

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

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

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

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

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

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

    if 1.1e-46 < z < 7.5

    1. Initial program 99.5%

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

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

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      3. *-commutative99.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. Taylor expanded in y around inf 81.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{z}} \]
    10. Step-by-step derivation
      1. mul-1-neg71.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+83}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-46}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \mathbf{elif}\;z \leq 7.5:\\ \;\;\;\;y \cdot \left(-\frac{x}{z}\right)\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+76}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 58.8% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.8000000000000002e45 or 8.5 < z

    1. Initial program 75.3%

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

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

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

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

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

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

    if -3.8000000000000002e45 < z < -2.29999999999999994e-100

    1. Initial program 96.6%

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

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

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      3. *-commutative99.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 65.0%

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

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

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

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

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

    if -2.29999999999999994e-100 < z < 3.2000000000000001e-57

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{x}}} \]
    7. Applied egg-rr81.3%

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

    if 3.2000000000000001e-57 < z < 8.5

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{x}{z}} \]
    11. Simplified65.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+45}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-100}:\\ \;\;\;\;x \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-57}:\\ \;\;\;\;\frac{y}{\frac{t}{x}}\\ \mathbf{elif}\;z \leq 8.5:\\ \;\;\;\;y \cdot \left(-\frac{x}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 58.9% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.8000000000000002e45 or 7.20000000000000018 < z

    1. Initial program 75.3%

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

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

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

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

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

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

    if -3.8000000000000002e45 < z < -1.39999999999999998e-100

    1. Initial program 96.6%

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

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

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      3. *-commutative99.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 65.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(-z\right) \cdot \frac{1}{t}\right)} \cdot x \]
      3. associate-*l*45.2%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \left(\frac{1}{t} \cdot x\right)} \]
      4. add-sqr-sqrt45.1%

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

        \[\leadsto \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot \left(\frac{1}{t} \cdot x\right) \]
      6. sqr-neg45.2%

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

        \[\leadsto \color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \left(\frac{1}{t} \cdot x\right) \]
      8. add-sqr-sqrt13.8%

        \[\leadsto \color{blue}{z} \cdot \left(\frac{1}{t} \cdot x\right) \]
      9. associate-/r/13.8%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{x}}} \]
      10. div-inv13.8%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{x}}} \]
      11. frac-2neg13.8%

        \[\leadsto \color{blue}{\frac{-z}{-\frac{t}{x}}} \]
      12. add-sqr-sqrt13.8%

        \[\leadsto \frac{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}{-\frac{t}{x}} \]
      13. sqrt-unprod13.8%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}{-\frac{t}{x}} \]
      14. sqr-neg13.8%

        \[\leadsto \frac{\sqrt{\color{blue}{z \cdot z}}}{-\frac{t}{x}} \]
      15. sqrt-unprod0.0%

        \[\leadsto \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{-\frac{t}{x}} \]
      16. add-sqr-sqrt45.2%

        \[\leadsto \frac{\color{blue}{z}}{-\frac{t}{x}} \]
      17. distribute-neg-frac45.2%

        \[\leadsto \frac{z}{\color{blue}{\frac{-t}{x}}} \]
    10. Applied egg-rr45.2%

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

    if -1.39999999999999998e-100 < z < 5.0000000000000002e-57

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{x}}} \]
    7. Applied egg-rr81.3%

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

    if 5.0000000000000002e-57 < z < 7.20000000000000018

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{x}{z}} \]
    11. Simplified65.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+45}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-100}:\\ \;\;\;\;\frac{z}{\frac{-t}{x}}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-57}:\\ \;\;\;\;\frac{y}{\frac{t}{x}}\\ \mathbf{elif}\;z \leq 7.2:\\ \;\;\;\;y \cdot \left(-\frac{x}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 58.8% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.8000000000000002e45 or 6.5 < z

    1. Initial program 75.3%

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

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

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

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

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

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

    if -3.8000000000000002e45 < z < -2.29999999999999994e-100

    1. Initial program 96.6%

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

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

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      3. *-commutative99.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 65.0%

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

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

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

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

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

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

    if -2.29999999999999994e-100 < z < 3.7999999999999997e-57

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{x}}} \]
    7. Applied egg-rr81.3%

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

    if 3.7999999999999997e-57 < z < 6.5

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{x}{z}} \]
    11. Simplified65.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+45}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-100}:\\ \;\;\;\;\frac{-x}{\frac{t}{z}}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-57}:\\ \;\;\;\;\frac{y}{\frac{t}{x}}\\ \mathbf{elif}\;z \leq 6.5:\\ \;\;\;\;y \cdot \left(-\frac{x}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 67.6% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.10000000000000032e82 or 8.3e9 < z

    1. Initial program 73.2%

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

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

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

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

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

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

    if -3.10000000000000032e82 < z < -2.60000000000000001e-95

    1. Initial program 94.8%

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

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

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      3. *-commutative99.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 63.1%

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

    if -2.60000000000000001e-95 < z < 8.3e9

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+82}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-95}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \mathbf{elif}\;z \leq 8300000000:\\ \;\;\;\;y \cdot \frac{x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 60.4% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.8000000000000002e45 or 3.7999999999999998 < z

    1. Initial program 75.3%

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

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

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

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

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

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

    if -3.8000000000000002e45 < z < 4.6999999999999998e-45

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

    if 4.6999999999999998e-45 < z < 3.7999999999999998

    1. Initial program 99.5%

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

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

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      3. *-commutative99.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. Taylor expanded in y around inf 81.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{z}} \]
    10. Step-by-step derivation
      1. mul-1-neg71.5%

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

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

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

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

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

Alternative 9: 60.4% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.8000000000000002e45 or 2.1000000000000001e-16 < z

    1. Initial program 76.9%

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

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

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

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

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

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

    if -3.8000000000000002e45 < z < 2.1000000000000001e-16

    1. Initial program 92.8%

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

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

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

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

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

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

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

Alternative 10: 59.6% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.8000000000000002e45 or 3.4e-16 < z

    1. Initial program 76.9%

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

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

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

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

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

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

    if -3.8000000000000002e45 < z < 3.4e-16

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 60.4% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.8000000000000002e45 or 3.7e-16 < z

    1. Initial program 76.9%

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

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

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

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

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

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

    if -3.8000000000000002e45 < z < 3.7e-16

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

Alternative 12: 34.8% accurate, 9.0× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 97.0% 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 2024011 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (/ x (/ (- t z) (- y z)))

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