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

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

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

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

Alternative 1: 96.8% 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 84.9%

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

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

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

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

Alternative 2: 75.2% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;y \leq -1.52 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{+88}:\\
\;\;\;\;\frac{x}{\frac{t}{-z} - -1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.3999999999999996e46 or -1.80000000000000002e-31 < y < -1.5200000000000001e-38

    1. Initial program 86.0%

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

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

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

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

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

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

    if -6.3999999999999996e46 < y < -1.80000000000000002e-31

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5200000000000001e-38 < y < 1.50000000000000003e88

    1. Initial program 86.9%

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num97.2%

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

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

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

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

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

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

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

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

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

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

    if 1.50000000000000003e88 < y

    1. Initial program 76.1%

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num89.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.4 \cdot 10^{+46}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-31}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;y \leq -1.52 \cdot 10^{-38}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+88}:\\ \;\;\;\;\frac{x}{\frac{t}{-z} - -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 75.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y}{t - z}\\ \mathbf{if}\;y \leq -1.7 \cdot 10^{+43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.25 \cdot 10^{-32}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;y \leq -8.2 \cdot 10^{-39} \lor \neg \left(y \leq 1.45 \cdot 10^{+88}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ y (- t z)))))
   (if (<= y -1.7e+43)
     t_1
     (if (<= y -2.25e-32)
       (* x (- 1.0 (/ y z)))
       (if (or (<= y -8.2e-39) (not (<= y 1.45e+88)))
         t_1
         (* x (/ z (- z t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (y / (t - z));
	double tmp;
	if (y <= -1.7e+43) {
		tmp = t_1;
	} else if (y <= -2.25e-32) {
		tmp = x * (1.0 - (y / z));
	} else if ((y <= -8.2e-39) || !(y <= 1.45e+88)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x * (y / (t - z))
    if (y <= (-1.7d+43)) then
        tmp = t_1
    else if (y <= (-2.25d-32)) then
        tmp = x * (1.0d0 - (y / z))
    else if ((y <= (-8.2d-39)) .or. (.not. (y <= 1.45d+88))) then
        tmp = t_1
    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 t_1 = x * (y / (t - z));
	double tmp;
	if (y <= -1.7e+43) {
		tmp = t_1;
	} else if (y <= -2.25e-32) {
		tmp = x * (1.0 - (y / z));
	} else if ((y <= -8.2e-39) || !(y <= 1.45e+88)) {
		tmp = t_1;
	} else {
		tmp = x * (z / (z - t));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (y / (t - z))
	tmp = 0
	if y <= -1.7e+43:
		tmp = t_1
	elif y <= -2.25e-32:
		tmp = x * (1.0 - (y / z))
	elif (y <= -8.2e-39) or not (y <= 1.45e+88):
		tmp = t_1
	else:
		tmp = x * (z / (z - t))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(y / Float64(t - z)))
	tmp = 0.0
	if (y <= -1.7e+43)
		tmp = t_1;
	elseif (y <= -2.25e-32)
		tmp = Float64(x * Float64(1.0 - Float64(y / z)));
	elseif ((y <= -8.2e-39) || !(y <= 1.45e+88))
		tmp = t_1;
	else
		tmp = Float64(x * Float64(z / Float64(z - t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (y / (t - z));
	tmp = 0.0;
	if (y <= -1.7e+43)
		tmp = t_1;
	elseif (y <= -2.25e-32)
		tmp = x * (1.0 - (y / z));
	elseif ((y <= -8.2e-39) || ~((y <= 1.45e+88)))
		tmp = t_1;
	else
		tmp = x * (z / (z - t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e+43], t$95$1, If[LessEqual[y, -2.25e-32], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -8.2e-39], N[Not[LessEqual[y, 1.45e+88]], $MachinePrecision]], t$95$1, N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -8.2 \cdot 10^{-39} \lor \neg \left(y \leq 1.45 \cdot 10^{+88}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.70000000000000006e43 or -2.25000000000000002e-32 < y < -8.2e-39 or 1.45e88 < y

    1. Initial program 82.4%

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

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

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

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

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

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

    if -1.70000000000000006e43 < y < -2.25000000000000002e-32

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.2e-39 < y < 1.45e88

    1. Initial program 86.9%

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot z}{t - z}} \]
      2. distribute-neg-frac274.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+43}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{elif}\;y \leq -2.25 \cdot 10^{-32}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;y \leq -8.2 \cdot 10^{-39} \lor \neg \left(y \leq 1.45 \cdot 10^{+88}\right):\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.3% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;y \leq -2.25 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.39999999999999989e45 or -6.9999999999999997e-33 < y < -2.25000000000000004e-38

    1. Initial program 86.0%

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

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

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

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

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

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

    if -2.39999999999999989e45 < y < -6.9999999999999997e-33

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.25000000000000004e-38 < y < 1.35e89

    1. Initial program 86.9%

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x \cdot z}{t - z}} \]
      2. distribute-neg-frac274.0%

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

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

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

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

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

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

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

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

    if 1.35e89 < y

    1. Initial program 76.1%

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num89.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+45}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-33}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;y \leq -2.25 \cdot 10^{-38}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+89}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 59.6% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.45 \cdot 10^{+53}:\\
\;\;\;\;\frac{x}{\frac{z}{-y}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.5499999999999998e115 or 2.99999999999999978e93 < z

    1. Initial program 71.6%

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

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

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

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

    if -3.5499999999999998e115 < z < -1.4500000000000001e53

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot y}{z}} \]
      6. neg-mul-170.9%

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

      \[\leadsto \color{blue}{x \cdot \frac{-y}{z}} \]
    11. Step-by-step derivation
      1. distribute-frac-neg70.9%

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y}{z}\right)} \]
      2. distribute-rgt-neg-out70.9%

        \[\leadsto \color{blue}{-x \cdot \frac{y}{z}} \]
      3. add-sqr-sqrt34.5%

        \[\leadsto -x \cdot \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z} \]
      4. sqrt-unprod29.8%

        \[\leadsto -x \cdot \frac{\color{blue}{\sqrt{y \cdot y}}}{z} \]
      5. sqr-neg29.8%

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

        \[\leadsto -x \cdot \frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{z} \]
      7. add-sqr-sqrt20.3%

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

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

        \[\leadsto -\color{blue}{\frac{x}{\frac{z}{-y}}} \]
      10. add-sqr-sqrt11.4%

        \[\leadsto -\frac{x}{\frac{z}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}} \]
      11. sqrt-unprod29.8%

        \[\leadsto -\frac{x}{\frac{z}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}} \]
      12. sqr-neg29.8%

        \[\leadsto -\frac{x}{\frac{z}{\sqrt{\color{blue}{y \cdot y}}}} \]
      13. sqrt-unprod34.5%

        \[\leadsto -\frac{x}{\frac{z}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}} \]
      14. add-sqr-sqrt71.2%

        \[\leadsto -\frac{x}{\frac{z}{\color{blue}{y}}} \]
    12. Applied egg-rr71.2%

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

    if -1.4500000000000001e53 < z < 2.99999999999999978e93

    1. Initial program 91.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.55 \cdot 10^{+115}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{+53}:\\ \;\;\;\;\frac{x}{\frac{z}{-y}}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+93}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 68.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-39} \lor \neg \left(z \leq 4.2 \cdot 10^{-112}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.0000000000000002e-39 or 4.2000000000000001e-112 < z

    1. Initial program 80.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000002e-39 < z < 4.2000000000000001e-112

    1. Initial program 91.4%

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

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

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

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

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

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

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

Alternative 7: 73.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+96} \lor \neg \left(z \leq 7.2 \cdot 10^{+94}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.0000000000000002e96 or 7.19999999999999985e94 < z

    1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000002e96 < z < 7.19999999999999985e94

    1. Initial program 92.0%

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

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

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

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

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

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

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

Alternative 8: 59.6% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.79999999999999957e105 or 2.8999999999999998e93 < z

    1. Initial program 71.9%

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

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

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

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

    if -7.79999999999999957e105 < z < 2.8999999999999998e93

    1. Initial program 92.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+105}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+93}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 35.1% 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 84.9%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification36.3%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 96.8% accurate, 1.0× speedup?

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

\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}

Reproduce

?
herbie shell --seed 2024072 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

  :alt
  (/ x (/ (- t z) (- y z)))

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