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

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

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

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

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

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

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

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

Alternative 2: 74.7% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.8000000000000003e47 or 1.5e-10 < z

    1. Initial program 77.2%

      \[\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 y around 0 68.4%

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

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

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

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

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

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

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

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

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

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

    if -3.8000000000000003e47 < z < 4e-264

    1. Initial program 95.1%

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

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

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

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

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

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

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

    if 4e-264 < z < 1.5e-10

    1. Initial program 94.3%

      \[\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-num96.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+47}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-264}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-10}:\\ \;\;\;\;\frac{x}{\frac{t - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 75.0% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.8000000000000003e47 or 1.8999999999999999e-10 < z

    1. Initial program 77.2%

      \[\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 y around 0 68.4%

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

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

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

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

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

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

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

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

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

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

    if -3.8000000000000003e47 < z < -1.5500000000000001e-207

    1. Initial program 93.4%

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

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

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

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

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

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

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

    if -1.5500000000000001e-207 < z < 1.8999999999999999e-10

    1. Initial program 95.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+47}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-207}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-10}:\\ \;\;\;\;\frac{x \cdot y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 69.3% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.2e-39 or 1.6e-77 < 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.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.2e-39 < z < 1.6e-77

    1. Initial program 94.3%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{x}{t}} \]
    7. Applied egg-rr68.2%

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

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

Alternative 5: 69.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-61} \lor \neg \left(z \leq 1.4 \cdot 10^{-10}\right):\\
\;\;\;\;x \cdot \frac{z}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.0999999999999999e-61 or 1.40000000000000008e-10 < z

    1. Initial program 79.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 y around 0 67.5%

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

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

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

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

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

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

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

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

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

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

    if -2.0999999999999999e-61 < z < 1.40000000000000008e-10

    1. Initial program 95.4%

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

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

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

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

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

Alternative 6: 73.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+47} \lor \neg \left(z \leq 1.9 \cdot 10^{-10}\right):\\
\;\;\;\;x \cdot \frac{z}{z - t}\\

\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.2e47 or 1.8999999999999999e-10 < z

    1. Initial program 77.2%

      \[\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 y around 0 68.4%

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

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

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

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

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

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

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

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

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

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

    if -4.2e47 < z < 1.8999999999999999e-10

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

Alternative 7: 61.4% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.7999999999999999e52 or 6.99999999999999961e-10 < z

    1. Initial program 76.8%

      \[\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 72.9%

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

    if -7.7999999999999999e52 < z < 6.99999999999999961e-10

    1. Initial program 94.8%

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

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

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

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

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

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

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

Alternative 8: 60.2% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.2e52 or 6.39999999999999961e-10 < z

    1. Initial program 76.8%

      \[\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 72.9%

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

    if -4.2e52 < z < 6.39999999999999961e-10

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

Alternative 9: 60.2% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.80000000000000005e51 or 2.00000000000000012e-9 < z

    1. Initial program 76.8%

      \[\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 72.9%

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

    if -1.80000000000000005e51 < z < 2.00000000000000012e-9

    1. Initial program 94.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+51}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-9}:\\ \;\;\;\;\frac{x \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 35.2% 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 85.9%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification41.7%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 97.1% 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 2024089 
(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)))