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

Percentage Accurate: 84.3% → 97.1%
Time: 7.3s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 84.3% accurate, 1.0× speedup?

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

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

Alternative 1: 97.1% 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 81.5%

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

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

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

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

Alternative 2: 68.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -7.2 \cdot 10^{-157}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 6.8 \cdot 10^{+71}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.50000000000000083e81 or 6.7999999999999997e71 < z

    1. Initial program 61.8%

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

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

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

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

    if -9.50000000000000083e81 < z < -7.2e-157 or 2.79999999999999995e-235 < z < 6.7999999999999997e71

    1. Initial program 92.7%

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

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

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

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

    if -7.2e-157 < z < 2.79999999999999995e-235

    1. Initial program 94.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+81}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-157}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-235}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+71}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 75.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -7 \cdot 10^{-157}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+65}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.4999999999999999e30 or 2.3e65 < z

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{z - t}{x}}} \]
      2. associate-/r/83.5%

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

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

    if -2.4999999999999999e30 < z < -7.0000000000000004e-157 or 6.2999999999999995e-235 < z < 2.3e65

    1. Initial program 94.9%

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

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

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

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

    if -7.0000000000000004e-157 < z < 6.2999999999999995e-235

    1. Initial program 94.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+30}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-157}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{elif}\;z \leq 6.3 \cdot 10^{-235}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+65}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \end{array} \]

Alternative 4: 75.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -1.02 \cdot 10^{-150}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 5.9 \cdot 10^{+63}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.79999999999999983e30 or 5.90000000000000029e63 < z

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{z - t}{x}}} \]
      2. associate-/r/83.5%

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

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

    if -2.79999999999999983e30 < z < -1.0199999999999999e-150 or 4.39999999999999968e-235 < z < 5.90000000000000029e63

    1. Initial program 94.7%

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

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

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

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

    if -1.0199999999999999e-150 < z < 4.39999999999999968e-235

    1. Initial program 94.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+30}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-150}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y}}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-235}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\ \mathbf{elif}\;z \leq 5.9 \cdot 10^{+63}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \end{array} \]

Alternative 5: 59.5% accurate, 0.7× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.1e42 or 6.99999999999999999e25 < z

    1. Initial program 63.2%

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

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

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

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

    if -4.1e42 < z < 5.40000000000000051e-172

    1. Initial program 96.4%

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

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

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

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

    if 5.40000000000000051e-172 < z < 2.70000000000000003e-117

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

    if 2.70000000000000003e-117 < z < 6.99999999999999999e25

    1. Initial program 92.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+42}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{-172}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-117}:\\ \;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+25}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 75.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+30} \lor \neg \left(z \leq 2.6 \cdot 10^{+34}\right):\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{t - z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -3.4e+30) (not (<= z 2.6e+34)))
   (* x (/ z (- z t)))
   (/ (* x y) (- t z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -3.4e+30) || !(z <= 2.6e+34)) {
		tmp = x * (z / (z - t));
	} else {
		tmp = (x * y) / (t - z);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-3.4d+30)) .or. (.not. (z <= 2.6d+34))) then
        tmp = x * (z / (z - t))
    else
        tmp = (x * y) / (t - z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -3.4e+30) || !(z <= 2.6e+34)) {
		tmp = x * (z / (z - t));
	} else {
		tmp = (x * y) / (t - z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -3.4e+30) or not (z <= 2.6e+34):
		tmp = x * (z / (z - t))
	else:
		tmp = (x * y) / (t - z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -3.4e+30) || !(z <= 2.6e+34))
		tmp = Float64(x * Float64(z / Float64(z - t)));
	else
		tmp = Float64(Float64(x * y) / Float64(t - z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -3.4e+30) || ~((z <= 2.6e+34)))
		tmp = x * (z / (z - t));
	else
		tmp = (x * y) / (t - z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.4e+30], N[Not[LessEqual[z, 2.6e+34]], $MachinePrecision]], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+30} \lor \neg \left(z \leq 2.6 \cdot 10^{+34}\right):\\
\;\;\;\;x \cdot \frac{z}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.4000000000000002e30 or 2.59999999999999997e34 < z

    1. Initial program 63.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{z - t}{x}}} \]
      2. associate-/r/81.9%

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

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

    if -3.4000000000000002e30 < z < 2.59999999999999997e34

    1. Initial program 95.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+30} \lor \neg \left(z \leq 2.6 \cdot 10^{+34}\right):\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{t - z}\\ \end{array} \]

Alternative 7: 69.4% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.49999999999999954e79 or 1.16000000000000005e69 < z

    1. Initial program 61.8%

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

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

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

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

    if -6.49999999999999954e79 < z < 1.16000000000000005e69

    1. Initial program 93.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+79}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.16 \cdot 10^{+69}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 8: 75.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+29}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\

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

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


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

    1. Initial program 55.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{z - t}{x}}} \]
      2. associate-/r/85.5%

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

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

    if -2.2000000000000001e29 < z < 2.39999999999999982e31

    1. Initial program 95.2%

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

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

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

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

    if 2.39999999999999982e31 < z

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+29}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+31}:\\ \;\;\;\;\frac{x \cdot y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z - y}{z}\\ \end{array} \]

Alternative 9: 61.3% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.60000000000000001e77 or 2.00000000000000011e32 < z

    1. Initial program 63.5%

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

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

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

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

    if -5.60000000000000001e77 < z < 2.00000000000000011e32

    1. Initial program 93.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.6 \cdot 10^{+77}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+32}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 60.6% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.90000000000000004e43 or 2.8000000000000002e25 < z

    1. Initial program 63.2%

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

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

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

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

    if -1.90000000000000004e43 < z < 2.8000000000000002e25

    1. Initial program 95.3%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Step-by-step derivation
      1. associate-*r/94.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. Taylor expanded in z around 0 67.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+43}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+25}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 35.6% 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 81.5%

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

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

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

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

    \[\leadsto x \]

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 2023238 
(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)))