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

Percentage Accurate: 84.7% → 96.9%
Time: 7.6s
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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 96.9% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 75.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+50}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -4.4 \cdot 10^{-35}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.25e50 or -1.05e-7 < z < -4.39999999999999987e-35

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e50 < z < -1.05e-7

    1. Initial program 85.3%

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

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

    if -4.39999999999999987e-35 < z < 7.5e7

    1. Initial program 95.6%

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

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

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

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

    if 7.5e7 < z

    1. Initial program 82.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{-x}{\color{blue}{\frac{t}{z} - \frac{z}{z}}} \]
      5. sub-neg86.4%

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

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

        \[\leadsto \frac{-x}{\frac{t}{z} + \color{blue}{-1}} \]
    6. Simplified86.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+50}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-7}:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-35}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 75000000:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\frac{t}{z} + -1}\\ \end{array} \]

Alternative 3: 68.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+49}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -2.1 \cdot 10^{-78} \lor \neg \left(z \leq 2.05 \cdot 10^{-83}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.7e49 or -0.017000000000000001 < z < -2.1000000000000001e-78 or 2.05e-83 < z

    1. Initial program 85.6%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{z}\right)} \]
      2. div-sub79.6%

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

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

        \[\leadsto x \cdot \left(-\left(\frac{y}{z} + \left(-\color{blue}{1}\right)\right)\right) \]
      5. metadata-eval79.6%

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

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

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

    if -1.7e49 < z < -0.017000000000000001

    1. Initial program 85.3%

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

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

    if -2.1000000000000001e-78 < z < 2.05e-83

    1. Initial program 95.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{t}{y}}} \]
    6. Simplified73.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+49}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -0.017:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-78} \lor \neg \left(z \leq 2.05 \cdot 10^{-83}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t}{y}}\\ \end{array} \]

Alternative 4: 74.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{+54}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -2.6 \cdot 10^{-35} \lor \neg \left(z \leq 7000000000000\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.29999999999999976e54 or -2.2999999999999998 < z < -2.60000000000000005e-35 or 7e12 < z

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

    if -4.29999999999999976e54 < z < -2.2999999999999998

    1. Initial program 85.3%

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

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

    if -2.60000000000000005e-35 < z < 7e12

    1. Initial program 95.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{+54}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -2.3:\\ \;\;\;\;x \cdot \frac{y - z}{t}\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-35} \lor \neg \left(z \leq 7000000000000\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{t - z}\\ \end{array} \]

Alternative 5: 59.9% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;z \leq 60000000000000:\\
\;\;\;\;\frac{-x}{\frac{z}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.2999999999999999e49 or 6e13 < z

    1. Initial program 82.6%

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

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

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

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

    if -4.2999999999999999e49 < z < 2.15000000000000009e-82

    1. Initial program 95.2%

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

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

    if 2.15000000000000009e-82 < z < 6e13

    1. Initial program 92.9%

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{-y}{z}} \]
    8. Step-by-step derivation
      1. distribute-frac-neg61.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{x}{\frac{z}{\color{blue}{y}}} \]
    9. Applied egg-rr61.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{+49}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-82}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 60000000000000:\\ \;\;\;\;\frac{-x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 59.8% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.60000000000000007e49 or 1e14 < z

    1. Initial program 82.6%

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

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

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

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

    if -1.60000000000000007e49 < z < 9.5e-88

    1. Initial program 95.2%

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

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

    if 9.5e-88 < z < 1e14

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+49}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-88}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 10^{+14}:\\ \;\;\;\;\frac{y}{\frac{z}{-x}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 7: 75.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+49} \lor \neg \left(z \leq 1300000000000\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 -2e+49) (not (<= z 1300000000000.0)))
   (* x (- 1.0 (/ y z)))
   (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -2e+49) || !(z <= 1300000000000.0)) {
		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 <= (-2d+49)) .or. (.not. (z <= 1300000000000.0d0))) 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 <= -2e+49) || !(z <= 1300000000000.0)) {
		tmp = x * (1.0 - (y / z));
	} else {
		tmp = x * (y / (t - z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -2e+49) or not (z <= 1300000000000.0):
		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 <= -2e+49) || !(z <= 1300000000000.0))
		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 <= -2e+49) || ~((z <= 1300000000000.0)))
		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, -2e+49], N[Not[LessEqual[z, 1300000000000.0]], $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 -2 \cdot 10^{+49} \lor \neg \left(z \leq 1300000000000\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 < -1.99999999999999989e49 or 1.3e12 < z

    1. Initial program 82.6%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{y - z}{z}\right)} \]
      2. div-sub83.9%

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

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

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

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

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

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

    if -1.99999999999999989e49 < z < 1.3e12

    1. Initial program 95.0%

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

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

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

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

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

Alternative 8: 60.9% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.6e52 or 3.7e14 < z

    1. Initial program 82.6%

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

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

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

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

    if -6.6e52 < z < 3.7e14

    1. Initial program 95.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 9: 35.0% 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 89.4%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification38.9%

    \[\leadsto x \]

Developer target: 96.9% 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 2023310 
(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)))