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

Percentage Accurate: 84.1% → 98.6%
Time: 7.0s
Alternatives: 9
Speedup: 0.7×

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 9 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.1% 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: 98.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot \frac{x}{t - z}\\ t_2 := \frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{-315}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_2 \leq 0:\\ \;\;\;\;\frac{y}{\frac{t}{x}}\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+290}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) (/ x (- t z)))) (t_2 (/ (* x (- y z)) (- t z))))
   (if (<= t_2 (- INFINITY))
     t_1
     (if (<= t_2 -2e-315)
       t_2
       (if (<= t_2 0.0) (/ y (/ t x)) (if (<= t_2 5e+290) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (x / (t - z));
	double t_2 = (x * (y - z)) / (t - z);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_2 <= -2e-315) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = y / (t / x);
	} else if (t_2 <= 5e+290) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (x / (t - z));
	double t_2 = (x * (y - z)) / (t - z);
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_2 <= -2e-315) {
		tmp = t_2;
	} else if (t_2 <= 0.0) {
		tmp = y / (t / x);
	} else if (t_2 <= 5e+290) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - z) * (x / (t - z))
	t_2 = (x * (y - z)) / (t - z)
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_1
	elif t_2 <= -2e-315:
		tmp = t_2
	elif t_2 <= 0.0:
		tmp = y / (t / x)
	elif t_2 <= 5e+290:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - z) * Float64(x / Float64(t - z)))
	t_2 = Float64(Float64(x * Float64(y - z)) / Float64(t - z))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_2 <= -2e-315)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = Float64(y / Float64(t / x));
	elseif (t_2 <= 5e+290)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y - z) * (x / (t - z));
	t_2 = (x * (y - z)) / (t - z);
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_1;
	elseif (t_2 <= -2e-315)
		tmp = t_2;
	elseif (t_2 <= 0.0)
		tmp = y / (t / x);
	elseif (t_2 <= 5e+290)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -2e-315], t$95$2, If[LessEqual[t$95$2, 0.0], N[(y / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+290], t$95$2, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot \frac{x}{t - z}\\
t_2 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-315}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{y}{\frac{t}{x}}\\

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+290}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -inf.0 or 4.9999999999999998e290 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

    1. Initial program 36.5%

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

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

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

    if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -2.0000000019e-315 or -0.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 4.9999999999999998e290

    1. Initial program 99.7%

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

    if -2.0000000019e-315 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -0.0

    1. Initial program 83.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{t}} \]
      2. clear-num99.9%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{x}}} \]
    8. Applied egg-rr100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -\infty:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -2 \cdot 10^{-315}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 0:\\ \;\;\;\;\frac{y}{\frac{t}{x}}\\ \mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 5 \cdot 10^{+290}:\\ \;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \end{array} \]

Alternative 2: 66.8% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.60000000000000008e80 or 1.25e85 < z

    1. Initial program 68.7%

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

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

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

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

    if -4.60000000000000008e80 < z < 2.5999999999999999e-89

    1. Initial program 91.5%

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

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

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

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

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

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

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

    if 2.5999999999999999e-89 < z < 4.99999999999999979e27

    1. Initial program 96.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t - z}{x}}} \]
      3. associate-/r/67.6%

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

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

    if 4.99999999999999979e27 < z < 1.25e85

    1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+80}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-89}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+27}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+85}:\\ \;\;\;\;\frac{-x}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 89.8% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 68.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-z\right) \cdot \color{blue}{\frac{-x}{-\left(t - z\right)}} \]
      3. associate-*r/54.9%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z} \cdot \left(-x\right)}{-\left(t - z\right)} \]
      9. add-sqr-sqrt5.0%

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

        \[\leadsto \frac{z \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\left(t - z\right)} \]
      11. sqr-neg21.4%

        \[\leadsto \frac{z \cdot \sqrt{\color{blue}{x \cdot x}}}{-\left(t - z\right)} \]
      12. sqrt-unprod22.9%

        \[\leadsto \frac{z \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}}{-\left(t - z\right)} \]
      13. add-sqr-sqrt54.9%

        \[\leadsto \frac{z \cdot \color{blue}{x}}{-\left(t - z\right)} \]
      14. sub-neg54.9%

        \[\leadsto \frac{z \cdot x}{-\color{blue}{\left(t + \left(-z\right)\right)}} \]
      15. distribute-neg-in54.9%

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

        \[\leadsto \frac{z \cdot x}{\left(-t\right) + \left(-\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}\right)} \]
      17. sqrt-unprod24.1%

        \[\leadsto \frac{z \cdot x}{\left(-t\right) + \left(-\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}\right)} \]
      18. sqr-neg24.1%

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

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

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

        \[\leadsto \frac{z \cdot x}{\left(-t\right) + \color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      22. sqrt-unprod9.8%

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

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

        \[\leadsto \frac{z \cdot x}{\left(-t\right) + \color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      25. add-sqr-sqrt54.9%

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{\left(-t\right) + z}{x}}} \]
      2. associate-/r/79.9%

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

        \[\leadsto \frac{z}{\color{blue}{z + \left(-t\right)}} \cdot x \]
      4. unsub-neg79.9%

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

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

    if -1.19999999999999991e87 < z < 1.85000000000000011e199

    1. Initial program 90.1%

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

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

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

    if 1.85000000000000011e199 < z

    1. Initial program 58.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-x}{\frac{z}{y - z}}} \]
    6. Simplified88.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+87}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+199}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\frac{z}{y - z}}\\ \end{array} \]

Alternative 4: 75.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{-28} \lor \neg \left(y \leq 10^{+51}\right):\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -7.4e-28) (not (<= y 1e+51)))
   (* x (/ y (- t z)))
   (* x (/ z (- z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -7.4e-28) || !(y <= 1e+51)) {
		tmp = x * (y / (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 ((y <= (-7.4d-28)) .or. (.not. (y <= 1d+51))) then
        tmp = x * (y / (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 ((y <= -7.4e-28) || !(y <= 1e+51)) {
		tmp = x * (y / (t - z));
	} else {
		tmp = x * (z / (z - t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -7.4e-28) or not (y <= 1e+51):
		tmp = x * (y / (t - z))
	else:
		tmp = x * (z / (z - t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -7.4e-28) || !(y <= 1e+51))
		tmp = Float64(x * Float64(y / 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 ((y <= -7.4e-28) || ~((y <= 1e+51)))
		tmp = x * (y / (t - z));
	else
		tmp = x * (z / (z - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.4e-28], N[Not[LessEqual[y, 1e+51]], $MachinePrecision]], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{-28} \lor \neg \left(y \leq 10^{+51}\right):\\
\;\;\;\;x \cdot \frac{y}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.40000000000000039e-28 or 1e51 < y

    1. Initial program 82.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t - z}{x}}} \]
      3. associate-/r/77.2%

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

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

    if -7.40000000000000039e-28 < y < 1e51

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-z\right) \cdot \color{blue}{\frac{-x}{-\left(t - z\right)}} \]
      3. associate-*r/67.8%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{z} \cdot \left(-x\right)}{-\left(t - z\right)} \]
      9. add-sqr-sqrt8.0%

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

        \[\leadsto \frac{z \cdot \color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{-\left(t - z\right)} \]
      11. sqr-neg30.9%

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

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

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

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

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

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

        \[\leadsto \frac{z \cdot x}{\left(-t\right) + \left(-\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}\right)} \]
      18. sqr-neg45.3%

        \[\leadsto \frac{z \cdot x}{\left(-t\right) + \left(-\sqrt{\color{blue}{z \cdot z}}\right)} \]
      19. sqrt-unprod18.5%

        \[\leadsto \frac{z \cdot x}{\left(-t\right) + \left(-\color{blue}{\sqrt{z} \cdot \sqrt{z}}\right)} \]
      20. add-sqr-sqrt35.3%

        \[\leadsto \frac{z \cdot x}{\left(-t\right) + \left(-\color{blue}{z}\right)} \]
      21. add-sqr-sqrt16.8%

        \[\leadsto \frac{z \cdot x}{\left(-t\right) + \color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      22. sqrt-unprod42.8%

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

        \[\leadsto \frac{z \cdot x}{\left(-t\right) + \sqrt{\color{blue}{z \cdot z}}} \]
      24. sqrt-unprod33.2%

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

        \[\leadsto \frac{z \cdot x}{\left(-t\right) + \color{blue}{z}} \]
    8. Applied egg-rr67.8%

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

        \[\leadsto \color{blue}{\frac{z}{\frac{\left(-t\right) + z}{x}}} \]
      2. associate-/r/78.6%

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

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

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

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

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

Alternative 5: 66.4% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.14999999999999995e86 or 1.5500000000000001e86 < z

    1. Initial program 68.7%

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

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

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

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

    if -1.14999999999999995e86 < z < 1.5500000000000001e86

    1. Initial program 91.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+86}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+86}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 59.0% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4999999999999999e78 or 4.7999999999999996e-24 < z

    1. Initial program 71.6%

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

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

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

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

    if -4.4999999999999999e78 < z < 4.7999999999999996e-24

    1. Initial program 91.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+78}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-24}:\\ \;\;\;\;y \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 7: 60.3% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.3999999999999999e78 or 2.50000000000000018e-18 < z

    1. Initial program 71.6%

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

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

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

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

    if -2.3999999999999999e78 < z < 2.50000000000000018e-18

    1. Initial program 91.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
    7. Step-by-step derivation
      1. *-commutative60.0%

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

        \[\leadsto \color{blue}{\frac{y}{t} \cdot x} \]
    8. Simplified65.0%

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

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

Alternative 8: 60.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.79999999999999997e80 or 1.79999999999999995e-21 < z

    1. Initial program 71.6%

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

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

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

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

    if -3.79999999999999997e80 < z < 1.79999999999999995e-21

    1. Initial program 91.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{t}{y}}} \]
    6. Simplified65.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+80}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 9: 34.8% accurate, 9.0× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification32.0%

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