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

Percentage Accurate: 84.7% → 97.2%
Time: 9.6s
Alternatives: 7
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 7 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.7% 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, 1.0× speedup?

\[\begin{array}{l} \\ \frac{y - z}{t - z} \cdot x \end{array} \]
(FPCore (x y z t) :precision binary64 (* (/ (- y z) (- t z)) x))
double code(double x, double y, double z, double t) {
	return ((y - z) / (t - z)) * 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 = ((y - z) / (t - z)) * x
end function
public static double code(double x, double y, double z, double t) {
	return ((y - z) / (t - z)) * x;
}
def code(x, y, z, t):
	return ((y - z) / (t - z)) * x
function code(x, y, z, t)
	return Float64(Float64(Float64(y - z) / Float64(t - z)) * x)
end
function tmp = code(x, y, z, t)
	tmp = ((y - z) / (t - z)) * x;
end
code[x_, y_, z_, t_] := N[(N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}

\\
\frac{y - z}{t - z} \cdot x
\end{array}
Derivation
  1. Initial program 82.0%

    \[\frac{x \cdot \left(y - z\right)}{t - z} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
    2. lift-*.f64N/A

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

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
    5. lower-*.f64N/A

      \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
    6. lower-/.f6497.4

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

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

Alternative 2: 89.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.95 \cdot 10^{+109}:\\
\;\;\;\;x \cdot \frac{z - y}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.9499999999999999e109

    1. Initial program 62.6%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      6. lower-/.f6499.9

        \[\leadsto \color{blue}{\frac{y - z}{t - z}} \cdot x \]
    4. Applied rewrites99.9%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(y - z\right)}{z}} \cdot x \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(y - z\right)}{z}} \cdot x \]
      3. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\left(y - z\right)\right)}}{z} \cdot x \]
      4. sub-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(y + \left(\mathsf{neg}\left(z\right)\right)\right)}\right)}{z} \cdot x \]
      5. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + y\right)}\right)}{z} \cdot x \]
      6. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}}{z} \cdot x \]
      7. unsub-negN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) - y}}{z} \cdot x \]
      8. remove-double-negN/A

        \[\leadsto \frac{\color{blue}{z} - y}{z} \cdot x \]
      9. lower--.f6484.3

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

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

    if -2.9499999999999999e109 < z < 3.2999999999999998e178

    1. Initial program 89.5%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot \left(y - z\right)}}{t - z} \]
      3. *-commutativeN/A

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

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{x}{t - z}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
      7. lower-/.f6493.6

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

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

    if 3.2999999999999998e178 < z

    1. Initial program 63.0%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
      2. frac-2negN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x \cdot \left(y - z\right)\right)}{\mathsf{neg}\left(\left(t - z\right)\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \left(y - z\right)\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \left(y - z\right)}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(y - z\right) \cdot x}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)} \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right)} \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)} \]
      7. associate-*l*N/A

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right)} \]
      8. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right)} \]
      9. lower-*.f64N/A

        \[\leadsto \left(y - z\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right)} \]
      10. lower-neg.f64N/A

        \[\leadsto \left(y - z\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right) \]
      11. lower-/.f64N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}}\right) \]
      12. neg-sub0N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{0 - \left(t - z\right)}}\right) \]
      13. lift--.f64N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{0 - \color{blue}{\left(t - z\right)}}\right) \]
      14. sub-negN/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{0 - \color{blue}{\left(t + \left(\mathsf{neg}\left(z\right)\right)\right)}}\right) \]
      15. +-commutativeN/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{0 - \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + t\right)}}\right) \]
      16. associate--r+N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{\left(0 - \left(\mathsf{neg}\left(z\right)\right)\right) - t}}\right) \]
      17. neg-sub0N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} - t}\right) \]
      18. remove-double-negN/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{z} - t}\right) \]
      19. lower--.f6454.6

        \[\leadsto \left(y - z\right) \cdot \left(\left(-x\right) \cdot \frac{1}{\color{blue}{z - t}}\right) \]
    4. Applied rewrites54.6%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{z}{z - t}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \frac{z}{z - t}} \]
      3. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{z}{z - t}} \]
      4. lower--.f6493.5

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

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

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

Alternative 3: 76.3% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.7999999999999999e33 or 3.40000000000000012e43 < y

    1. Initial program 80.4%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{t - z}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \frac{y}{t - z}} \]
      3. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y}{t - z}} \]
      4. lower--.f6481.9

        \[\leadsto x \cdot \frac{y}{\color{blue}{t - z}} \]
    5. Applied rewrites81.9%

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

    if -6.7999999999999999e33 < y < 3.40000000000000012e43

    1. Initial program 83.3%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
      2. frac-2negN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x \cdot \left(y - z\right)\right)}{\mathsf{neg}\left(\left(t - z\right)\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \left(y - z\right)\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \left(y - z\right)}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(y - z\right) \cdot x}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)} \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right)} \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)} \]
      7. associate-*l*N/A

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right)} \]
      8. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right)} \]
      9. lower-*.f64N/A

        \[\leadsto \left(y - z\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right)} \]
      10. lower-neg.f64N/A

        \[\leadsto \left(y - z\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right) \]
      11. lower-/.f64N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}}\right) \]
      12. neg-sub0N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{0 - \left(t - z\right)}}\right) \]
      13. lift--.f64N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{0 - \color{blue}{\left(t - z\right)}}\right) \]
      14. sub-negN/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{0 - \color{blue}{\left(t + \left(\mathsf{neg}\left(z\right)\right)\right)}}\right) \]
      15. +-commutativeN/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{0 - \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + t\right)}}\right) \]
      16. associate--r+N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{\left(0 - \left(\mathsf{neg}\left(z\right)\right)\right) - t}}\right) \]
      17. neg-sub0N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} - t}\right) \]
      18. remove-double-negN/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{z} - t}\right) \]
      19. lower--.f6485.3

        \[\leadsto \left(y - z\right) \cdot \left(\left(-x\right) \cdot \frac{1}{\color{blue}{z - t}}\right) \]
    4. Applied rewrites85.3%

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

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

        \[\leadsto \color{blue}{x \cdot \frac{z}{z - t}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \frac{z}{z - t}} \]
      3. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{z}{z - t}} \]
      4. lower--.f6476.7

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

      \[\leadsto \color{blue}{x \cdot \frac{z}{z - t}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 70.3% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.08000000000000003e-35 or 2.2499999999999999e-66 < z

    1. Initial program 73.8%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
      2. frac-2negN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(x \cdot \left(y - z\right)\right)}{\mathsf{neg}\left(\left(t - z\right)\right)}} \]
      3. div-invN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x \cdot \left(y - z\right)\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \left(y - z\right)}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(y - z\right) \cdot x}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)} \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\left(y - z\right) \cdot \left(\mathsf{neg}\left(x\right)\right)\right)} \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)} \]
      7. associate-*l*N/A

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right)} \]
      8. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right)} \]
      9. lower-*.f64N/A

        \[\leadsto \left(y - z\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right)} \]
      10. lower-neg.f64N/A

        \[\leadsto \left(y - z\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}\right) \]
      11. lower-/.f64N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(\left(t - z\right)\right)}}\right) \]
      12. neg-sub0N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{0 - \left(t - z\right)}}\right) \]
      13. lift--.f64N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{0 - \color{blue}{\left(t - z\right)}}\right) \]
      14. sub-negN/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{0 - \color{blue}{\left(t + \left(\mathsf{neg}\left(z\right)\right)\right)}}\right) \]
      15. +-commutativeN/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{0 - \color{blue}{\left(\left(\mathsf{neg}\left(z\right)\right) + t\right)}}\right) \]
      16. associate--r+N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{\left(0 - \left(\mathsf{neg}\left(z\right)\right)\right) - t}}\right) \]
      17. neg-sub0N/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} - t}\right) \]
      18. remove-double-negN/A

        \[\leadsto \left(y - z\right) \cdot \left(\left(\mathsf{neg}\left(x\right)\right) \cdot \frac{1}{\color{blue}{z} - t}\right) \]
      19. lower--.f6479.1

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{z}{z - t}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \frac{z}{z - t}} \]
      3. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{z}{z - t}} \]
      4. lower--.f6472.0

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

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

    if -1.08000000000000003e-35 < z < 2.2499999999999999e-66

    1. Initial program 92.8%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      6. lower-/.f6494.3

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

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

      \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
    6. Step-by-step derivation
      1. lower-/.f6472.9

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

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

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

Alternative 5: 60.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+14}:\\
\;\;\;\;x \cdot 1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.6e14 or 1.3e59 < z

    1. Initial program 68.5%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      6. lower-/.f6499.9

        \[\leadsto \color{blue}{\frac{y - z}{t - z}} \cdot x \]
    4. Applied rewrites99.9%

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

      \[\leadsto \color{blue}{1} \cdot x \]
    6. Step-by-step derivation
      1. Applied rewrites59.5%

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

      if -8.6e14 < z < 1.3e59

      1. Initial program 92.4%

        \[\frac{x \cdot \left(y - z\right)}{t - z} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
        2. lift-*.f64N/A

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

          \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
        5. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
        6. lower-/.f6495.6

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

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

        \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
      6. Step-by-step derivation
        1. lower-/.f6465.4

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

        \[\leadsto \color{blue}{\frac{y}{t}} \cdot x \]
    7. Recombined 2 regimes into one program.
    8. Final simplification62.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.6 \cdot 10^{+14}:\\ \;\;\;\;x \cdot 1\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+59}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \]
    9. Add Preprocessing

    Alternative 6: 59.3% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+14}:\\ \;\;\;\;x \cdot 1\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+58}:\\ \;\;\;\;y \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= z -5.2e+14) (* x 1.0) (if (<= z 1.55e+58) (* y (/ x t)) (* x 1.0))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -5.2e+14) {
    		tmp = x * 1.0;
    	} else if (z <= 1.55e+58) {
    		tmp = y * (x / t);
    	} else {
    		tmp = x * 1.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: tmp
        if (z <= (-5.2d+14)) then
            tmp = x * 1.0d0
        else if (z <= 1.55d+58) then
            tmp = y * (x / t)
        else
            tmp = x * 1.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -5.2e+14) {
    		tmp = x * 1.0;
    	} else if (z <= 1.55e+58) {
    		tmp = y * (x / t);
    	} else {
    		tmp = x * 1.0;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	tmp = 0
    	if z <= -5.2e+14:
    		tmp = x * 1.0
    	elif z <= 1.55e+58:
    		tmp = y * (x / t)
    	else:
    		tmp = x * 1.0
    	return tmp
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (z <= -5.2e+14)
    		tmp = Float64(x * 1.0);
    	elseif (z <= 1.55e+58)
    		tmp = Float64(y * Float64(x / t));
    	else
    		tmp = Float64(x * 1.0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (z <= -5.2e+14)
    		tmp = x * 1.0;
    	elseif (z <= 1.55e+58)
    		tmp = y * (x / t);
    	else
    		tmp = x * 1.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e+14], N[(x * 1.0), $MachinePrecision], If[LessEqual[z, 1.55e+58], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(x * 1.0), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -5.2 \cdot 10^{+14}:\\
    \;\;\;\;x \cdot 1\\
    
    \mathbf{elif}\;z \leq 1.55 \cdot 10^{+58}:\\
    \;\;\;\;y \cdot \frac{x}{t}\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot 1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -5.2e14 or 1.55e58 < z

      1. Initial program 68.5%

        \[\frac{x \cdot \left(y - z\right)}{t - z} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
        2. lift-*.f64N/A

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

          \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
        5. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
        6. lower-/.f6499.9

          \[\leadsto \color{blue}{\frac{y - z}{t - z}} \cdot x \]
      4. Applied rewrites99.9%

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

        \[\leadsto \color{blue}{1} \cdot x \]
      6. Step-by-step derivation
        1. Applied rewrites59.5%

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

        if -5.2e14 < z < 1.55e58

        1. Initial program 92.4%

          \[\frac{x \cdot \left(y - z\right)}{t - z} \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

          \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
          2. lower-*.f6461.7

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

          \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
        6. Step-by-step derivation
          1. Applied rewrites64.2%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+14}:\\ \;\;\;\;x \cdot 1\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+58}:\\ \;\;\;\;y \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \]
        9. Add Preprocessing

        Alternative 7: 34.5% accurate, 3.8× speedup?

        \[\begin{array}{l} \\ x \cdot 1 \end{array} \]
        (FPCore (x y z t) :precision binary64 (* x 1.0))
        double code(double x, double y, double z, double t) {
        	return x * 1.0;
        }
        
        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 * 1.0d0
        end function
        
        public static double code(double x, double y, double z, double t) {
        	return x * 1.0;
        }
        
        def code(x, y, z, t):
        	return x * 1.0
        
        function code(x, y, z, t)
        	return Float64(x * 1.0)
        end
        
        function tmp = code(x, y, z, t)
        	tmp = x * 1.0;
        end
        
        code[x_, y_, z_, t_] := N[(x * 1.0), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        x \cdot 1
        \end{array}
        
        Derivation
        1. Initial program 82.0%

          \[\frac{x \cdot \left(y - z\right)}{t - z} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
          2. lift-*.f64N/A

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

            \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
          4. *-commutativeN/A

            \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
          5. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
          6. lower-/.f6497.4

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

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

          \[\leadsto \color{blue}{1} \cdot x \]
        6. Step-by-step derivation
          1. Applied rewrites31.7%

            \[\leadsto \color{blue}{1} \cdot x \]
          2. Final simplification31.7%

            \[\leadsto x \cdot 1 \]
          3. Add Preprocessing

          Developer Target 1: 97.1% accurate, 0.8× 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 2024233 
          (FPCore (x y z t)
            :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
            :precision binary64
          
            :alt
            (! :herbie-platform default (/ x (/ (- t z) (- y z))))
          
            (/ (* x (- y z)) (- t z)))