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

Percentage Accurate: 84.5% → 96.5%
Time: 8.5s
Alternatives: 8
Speedup: 0.8×

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 8 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.5% 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.5% accurate, 0.8× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 2 \cdot 10^{-66}:\\ \;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x\_m}{t - z} \cdot \left(y - z\right)\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= x_m 2e-66) (/ (* x_m (- y z)) (- t z)) (* (/ x_m (- t z)) (- y z)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (x_m <= 2e-66) {
		tmp = (x_m * (y - z)) / (t - z);
	} else {
		tmp = (x_m / (t - z)) * (y - z);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x_m <= 2d-66) then
        tmp = (x_m * (y - z)) / (t - z)
    else
        tmp = (x_m / (t - z)) * (y - z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (x_m <= 2e-66) {
		tmp = (x_m * (y - z)) / (t - z);
	} else {
		tmp = (x_m / (t - z)) * (y - z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if x_m <= 2e-66:
		tmp = (x_m * (y - z)) / (t - z)
	else:
		tmp = (x_m / (t - z)) * (y - z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (x_m <= 2e-66)
		tmp = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z));
	else
		tmp = Float64(Float64(x_m / Float64(t - z)) * Float64(y - z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (x_m <= 2e-66)
		tmp = (x_m * (y - z)) / (t - z);
	else
		tmp = (x_m / (t - z)) * (y - z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 2e-66], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 2 \cdot 10^{-66}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2e-66

    1. Initial program 86.5%

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

    if 2e-66 < x

    1. Initial program 83.5%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot \left(y - z\right)}}{t - z} \]
      3. *-commutativeN/A

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

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{x}{t - z}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
      6. lower-*.f64N/A

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

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

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

Alternative 2: 90.2% accurate, 0.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+193}:\\ \;\;\;\;\frac{z - y}{z} \cdot x\_m\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+139}:\\ \;\;\;\;\frac{x\_m}{t - z} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{t - z} \cdot \left(-x\_m\right)\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= z -1.1e+193)
    (* (/ (- z y) z) x_m)
    (if (<= z 1.25e+139)
      (* (/ x_m (- t z)) (- y z))
      (* (/ z (- t z)) (- x_m))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -1.1e+193) {
		tmp = ((z - y) / z) * x_m;
	} else if (z <= 1.25e+139) {
		tmp = (x_m / (t - z)) * (y - z);
	} else {
		tmp = (z / (t - z)) * -x_m;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-1.1d+193)) then
        tmp = ((z - y) / z) * x_m
    else if (z <= 1.25d+139) then
        tmp = (x_m / (t - z)) * (y - z)
    else
        tmp = (z / (t - z)) * -x_m
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -1.1e+193) {
		tmp = ((z - y) / z) * x_m;
	} else if (z <= 1.25e+139) {
		tmp = (x_m / (t - z)) * (y - z);
	} else {
		tmp = (z / (t - z)) * -x_m;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= -1.1e+193:
		tmp = ((z - y) / z) * x_m
	elif z <= 1.25e+139:
		tmp = (x_m / (t - z)) * (y - z)
	else:
		tmp = (z / (t - z)) * -x_m
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= -1.1e+193)
		tmp = Float64(Float64(Float64(z - y) / z) * x_m);
	elseif (z <= 1.25e+139)
		tmp = Float64(Float64(x_m / Float64(t - z)) * Float64(y - z));
	else
		tmp = Float64(Float64(z / Float64(t - z)) * Float64(-x_m));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= -1.1e+193)
		tmp = ((z - y) / z) * x_m;
	elseif (z <= 1.25e+139)
		tmp = (x_m / (t - z)) * (y - z);
	else
		tmp = (z / (t - z)) * -x_m;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.1e+193], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x$95$m), $MachinePrecision], If[LessEqual[z, 1.25e+139], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] * (-x$95$m)), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+193}:\\
\;\;\;\;\frac{z - y}{z} \cdot x\_m\\

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

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


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

    1. Initial program 65.5%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{y - z}{z}}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{y - z}{z} \cdot x}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
      6. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
      8. *-lft-identityN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{1 \cdot z}\right)\right)}{z} \cdot x \]
      9. metadata-evalN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot z\right)\right)}{z} \cdot x \]
      10. fp-cancel-sign-sub-invN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(y + -1 \cdot z\right)}\right)}{z} \cdot x \]
      11. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + y\right)}\right)}{z} \cdot x \]
      12. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}}{z} \cdot x \]
      13. mul-1-negN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
      14. remove-double-negN/A

        \[\leadsto \frac{\color{blue}{z} + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
      15. mul-1-negN/A

        \[\leadsto \frac{z + \color{blue}{-1 \cdot y}}{z} \cdot x \]
      16. metadata-evalN/A

        \[\leadsto \frac{z + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)} \cdot y}{z} \cdot x \]
      17. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{\color{blue}{z - 1 \cdot y}}{z} \cdot x \]
      18. *-lft-identityN/A

        \[\leadsto \frac{z - \color{blue}{y}}{z} \cdot x \]
      19. lower--.f6493.7

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

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

    if -1.09999999999999993e193 < z < 1.25000000000000007e139

    1. Initial program 89.8%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot \left(y - z\right)}}{t - z} \]
      3. *-commutativeN/A

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

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{x}{t - z}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
      7. lower-/.f6494.7

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

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

    if 1.25000000000000007e139 < z

    1. Initial program 70.9%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{t - z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot z}{t - z}\right)} \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{z}{t - z}}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{z}{t - z} \cdot x}\right) \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\frac{z}{t - z} \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
      5. mul-1-negN/A

        \[\leadsto \frac{z}{t - z} \cdot \color{blue}{\left(-1 \cdot x\right)} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t - z} \cdot \left(-1 \cdot x\right)} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t - z}} \cdot \left(-1 \cdot x\right) \]
      8. lower--.f64N/A

        \[\leadsto \frac{z}{\color{blue}{t - z}} \cdot \left(-1 \cdot x\right) \]
      9. mul-1-negN/A

        \[\leadsto \frac{z}{t - z} \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
      10. lower-neg.f6493.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+193}:\\ \;\;\;\;\frac{z - y}{z} \cdot x\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+139}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{t - z} \cdot \left(-x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.7% accurate, 0.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -29500000:\\ \;\;\;\;\frac{z - y}{z} \cdot x\_m\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-26}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{t - z} \cdot \left(-x\_m\right)\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= z -29500000.0)
    (* (/ (- z y) z) x_m)
    (if (<= z 4e-26) (/ (* (- y z) x_m) t) (* (/ z (- t z)) (- x_m))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -29500000.0) {
		tmp = ((z - y) / z) * x_m;
	} else if (z <= 4e-26) {
		tmp = ((y - z) * x_m) / t;
	} else {
		tmp = (z / (t - z)) * -x_m;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-29500000.0d0)) then
        tmp = ((z - y) / z) * x_m
    else if (z <= 4d-26) then
        tmp = ((y - z) * x_m) / t
    else
        tmp = (z / (t - z)) * -x_m
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -29500000.0) {
		tmp = ((z - y) / z) * x_m;
	} else if (z <= 4e-26) {
		tmp = ((y - z) * x_m) / t;
	} else {
		tmp = (z / (t - z)) * -x_m;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if z <= -29500000.0:
		tmp = ((z - y) / z) * x_m
	elif z <= 4e-26:
		tmp = ((y - z) * x_m) / t
	else:
		tmp = (z / (t - z)) * -x_m
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= -29500000.0)
		tmp = Float64(Float64(Float64(z - y) / z) * x_m);
	elseif (z <= 4e-26)
		tmp = Float64(Float64(Float64(y - z) * x_m) / t);
	else
		tmp = Float64(Float64(z / Float64(t - z)) * Float64(-x_m));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (z <= -29500000.0)
		tmp = ((z - y) / z) * x_m;
	elseif (z <= 4e-26)
		tmp = ((y - z) * x_m) / t;
	else
		tmp = (z / (t - z)) * -x_m;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -29500000.0], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x$95$m), $MachinePrecision], If[LessEqual[z, 4e-26], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision], N[(N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] * (-x$95$m)), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -29500000:\\
\;\;\;\;\frac{z - y}{z} \cdot x\_m\\

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

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


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

    1. Initial program 69.1%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{y - z}{z}}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{y - z}{z} \cdot x}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
      6. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
      8. *-lft-identityN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{1 \cdot z}\right)\right)}{z} \cdot x \]
      9. metadata-evalN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot z\right)\right)}{z} \cdot x \]
      10. fp-cancel-sign-sub-invN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(y + -1 \cdot z\right)}\right)}{z} \cdot x \]
      11. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + y\right)}\right)}{z} \cdot x \]
      12. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}}{z} \cdot x \]
      13. mul-1-negN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
      14. remove-double-negN/A

        \[\leadsto \frac{\color{blue}{z} + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
      15. mul-1-negN/A

        \[\leadsto \frac{z + \color{blue}{-1 \cdot y}}{z} \cdot x \]
      16. metadata-evalN/A

        \[\leadsto \frac{z + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)} \cdot y}{z} \cdot x \]
      17. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{\color{blue}{z - 1 \cdot y}}{z} \cdot x \]
      18. *-lft-identityN/A

        \[\leadsto \frac{z - \color{blue}{y}}{z} \cdot x \]
      19. lower--.f6478.4

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

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

    if -2.95e7 < z < 4.0000000000000002e-26

    1. Initial program 96.2%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot \left(y - z\right)}}{t - z} \]
      3. *-commutativeN/A

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

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{x}{t - z}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
      7. lower-/.f6494.9

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

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

      \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t}} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{t} \]
      3. lower-*.f64N/A

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

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

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

    if 4.0000000000000002e-26 < z

    1. Initial program 80.5%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{t - z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x \cdot z}{t - z}\right)} \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{z}{t - z}}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{z}{t - z} \cdot x}\right) \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\frac{z}{t - z} \cdot \left(\mathsf{neg}\left(x\right)\right)} \]
      5. mul-1-negN/A

        \[\leadsto \frac{z}{t - z} \cdot \color{blue}{\left(-1 \cdot x\right)} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t - z} \cdot \left(-1 \cdot x\right)} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{z}{t - z}} \cdot \left(-1 \cdot x\right) \]
      8. lower--.f64N/A

        \[\leadsto \frac{z}{\color{blue}{t - z}} \cdot \left(-1 \cdot x\right) \]
      9. mul-1-negN/A

        \[\leadsto \frac{z}{t - z} \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
      10. lower-neg.f6481.4

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

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

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

Alternative 4: 73.8% accurate, 0.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -29500000 \lor \neg \left(z \leq 4.8 \cdot 10^{-26}\right):\\ \;\;\;\;\frac{z - y}{z} \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -29500000.0) (not (<= z 4.8e-26)))
    (* (/ (- z y) z) x_m)
    (/ (* (- y z) x_m) t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -29500000.0) || !(z <= 4.8e-26)) {
		tmp = ((z - y) / z) * x_m;
	} else {
		tmp = ((y - z) * x_m) / t;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-29500000.0d0)) .or. (.not. (z <= 4.8d-26))) then
        tmp = ((z - y) / z) * x_m
    else
        tmp = ((y - z) * x_m) / t
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -29500000.0) || !(z <= 4.8e-26)) {
		tmp = ((z - y) / z) * x_m;
	} else {
		tmp = ((y - z) * x_m) / t;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -29500000.0) or not (z <= 4.8e-26):
		tmp = ((z - y) / z) * x_m
	else:
		tmp = ((y - z) * x_m) / t
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -29500000.0) || !(z <= 4.8e-26))
		tmp = Float64(Float64(Float64(z - y) / z) * x_m);
	else
		tmp = Float64(Float64(Float64(y - z) * x_m) / t);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -29500000.0) || ~((z <= 4.8e-26)))
		tmp = ((z - y) / z) * x_m;
	else
		tmp = ((y - z) * x_m) / t;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -29500000.0], N[Not[LessEqual[z, 4.8e-26]], $MachinePrecision]], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -29500000 \lor \neg \left(z \leq 4.8 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{z - y}{z} \cdot x\_m\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.95e7 or 4.8000000000000002e-26 < z

    1. Initial program 74.7%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{y - z}{z}}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{y - z}{z} \cdot x}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
      6. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
      8. *-lft-identityN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{1 \cdot z}\right)\right)}{z} \cdot x \]
      9. metadata-evalN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot z\right)\right)}{z} \cdot x \]
      10. fp-cancel-sign-sub-invN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(y + -1 \cdot z\right)}\right)}{z} \cdot x \]
      11. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + y\right)}\right)}{z} \cdot x \]
      12. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}}{z} \cdot x \]
      13. mul-1-negN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
      14. remove-double-negN/A

        \[\leadsto \frac{\color{blue}{z} + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
      15. mul-1-negN/A

        \[\leadsto \frac{z + \color{blue}{-1 \cdot y}}{z} \cdot x \]
      16. metadata-evalN/A

        \[\leadsto \frac{z + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)} \cdot y}{z} \cdot x \]
      17. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{\color{blue}{z - 1 \cdot y}}{z} \cdot x \]
      18. *-lft-identityN/A

        \[\leadsto \frac{z - \color{blue}{y}}{z} \cdot x \]
      19. lower--.f6475.9

        \[\leadsto \frac{\color{blue}{z - y}}{z} \cdot x \]
    5. Applied rewrites75.9%

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

    if -2.95e7 < z < 4.8000000000000002e-26

    1. Initial program 96.2%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot \left(y - z\right)}}{t - z} \]
      3. *-commutativeN/A

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

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{x}{t - z}} \]
      5. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
      7. lower-/.f6494.9

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

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

      \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t}} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{t} \]
      3. lower-*.f64N/A

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

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

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

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

Alternative 5: 70.7% accurate, 0.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -46000000 \lor \neg \left(z \leq 4.8 \cdot 10^{-26}\right):\\ \;\;\;\;x\_m - \frac{y \cdot x\_m}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (or (<= z -46000000.0) (not (<= z 4.8e-26)))
    (- x_m (/ (* y x_m) z))
    (/ (* (- y z) x_m) t))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -46000000.0) || !(z <= 4.8e-26)) {
		tmp = x_m - ((y * x_m) / z);
	} else {
		tmp = ((y - z) * x_m) / t;
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
real(8) function code(x_s, x_m, y, z, t)
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-46000000.0d0)) .or. (.not. (z <= 4.8d-26))) then
        tmp = x_m - ((y * x_m) / z)
    else
        tmp = ((y - z) * x_m) / t
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if ((z <= -46000000.0) || !(z <= 4.8e-26)) {
		tmp = x_m - ((y * x_m) / z);
	} else {
		tmp = ((y - z) * x_m) / t;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if (z <= -46000000.0) or not (z <= 4.8e-26):
		tmp = x_m - ((y * x_m) / z)
	else:
		tmp = ((y - z) * x_m) / t
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if ((z <= -46000000.0) || !(z <= 4.8e-26))
		tmp = Float64(x_m - Float64(Float64(y * x_m) / z));
	else
		tmp = Float64(Float64(Float64(y - z) * x_m) / t);
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if ((z <= -46000000.0) || ~((z <= 4.8e-26)))
		tmp = x_m - ((y * x_m) / z);
	else
		tmp = ((y - z) * x_m) / t;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -46000000.0], N[Not[LessEqual[z, 4.8e-26]], $MachinePrecision]], N[(x$95$m - N[(N[(y * x$95$m), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -46000000 \lor \neg \left(z \leq 4.8 \cdot 10^{-26}\right):\\
\;\;\;\;x\_m - \frac{y \cdot x\_m}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.6e7 or 4.8000000000000002e-26 < z

    1. Initial program 74.7%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{y - z}{z}}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{y - z}{z} \cdot x}\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
      6. distribute-neg-fracN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
      8. *-lft-identityN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{1 \cdot z}\right)\right)}{z} \cdot x \]
      9. metadata-evalN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot z\right)\right)}{z} \cdot x \]
      10. fp-cancel-sign-sub-invN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(y + -1 \cdot z\right)}\right)}{z} \cdot x \]
      11. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + y\right)}\right)}{z} \cdot x \]
      12. distribute-neg-inN/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}}{z} \cdot x \]
      13. mul-1-negN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
      14. remove-double-negN/A

        \[\leadsto \frac{\color{blue}{z} + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
      15. mul-1-negN/A

        \[\leadsto \frac{z + \color{blue}{-1 \cdot y}}{z} \cdot x \]
      16. metadata-evalN/A

        \[\leadsto \frac{z + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)} \cdot y}{z} \cdot x \]
      17. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{\color{blue}{z - 1 \cdot y}}{z} \cdot x \]
      18. *-lft-identityN/A

        \[\leadsto \frac{z - \color{blue}{y}}{z} \cdot x \]
      19. lower--.f6475.9

        \[\leadsto \frac{\color{blue}{z - y}}{z} \cdot x \]
    5. Applied rewrites75.9%

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

      \[\leadsto x + \color{blue}{-1 \cdot \frac{x \cdot y}{z}} \]
    7. Step-by-step derivation
      1. Applied rewrites70.9%

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

      if -4.6e7 < z < 4.8000000000000002e-26

      1. Initial program 96.2%

        \[\frac{x \cdot \left(y - z\right)}{t - z} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot \left(y - z\right)}}{t - z} \]
        3. *-commutativeN/A

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

          \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{x}{t - z}} \]
        5. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
        6. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
        7. lower-/.f6494.9

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t}} \]
      6. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t}} \]
        2. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{t} \]
        3. lower-*.f64N/A

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

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

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

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

    Alternative 6: 66.1% accurate, 0.7× speedup?

    \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+46} \lor \neg \left(z \leq 1.65 \cdot 10^{+82}\right):\\ \;\;\;\;1 \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\ \end{array} \end{array} \]
    x\_m = (fabs.f64 x)
    x\_s = (copysign.f64 #s(literal 1 binary64) x)
    (FPCore (x_s x_m y z t)
     :precision binary64
     (*
      x_s
      (if (or (<= z -4.6e+46) (not (<= z 1.65e+82)))
        (* 1.0 x_m)
        (/ (* (- y z) x_m) t))))
    x\_m = fabs(x);
    x\_s = copysign(1.0, x);
    double code(double x_s, double x_m, double y, double z, double t) {
    	double tmp;
    	if ((z <= -4.6e+46) || !(z <= 1.65e+82)) {
    		tmp = 1.0 * x_m;
    	} else {
    		tmp = ((y - z) * x_m) / t;
    	}
    	return x_s * tmp;
    }
    
    x\_m = abs(x)
    x\_s = copysign(1.0d0, x)
    real(8) function code(x_s, x_m, y, z, t)
        real(8), intent (in) :: x_s
        real(8), intent (in) :: x_m
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: tmp
        if ((z <= (-4.6d+46)) .or. (.not. (z <= 1.65d+82))) then
            tmp = 1.0d0 * x_m
        else
            tmp = ((y - z) * x_m) / t
        end if
        code = x_s * tmp
    end function
    
    x\_m = Math.abs(x);
    x\_s = Math.copySign(1.0, x);
    public static double code(double x_s, double x_m, double y, double z, double t) {
    	double tmp;
    	if ((z <= -4.6e+46) || !(z <= 1.65e+82)) {
    		tmp = 1.0 * x_m;
    	} else {
    		tmp = ((y - z) * x_m) / t;
    	}
    	return x_s * tmp;
    }
    
    x\_m = math.fabs(x)
    x\_s = math.copysign(1.0, x)
    def code(x_s, x_m, y, z, t):
    	tmp = 0
    	if (z <= -4.6e+46) or not (z <= 1.65e+82):
    		tmp = 1.0 * x_m
    	else:
    		tmp = ((y - z) * x_m) / t
    	return x_s * tmp
    
    x\_m = abs(x)
    x\_s = copysign(1.0, x)
    function code(x_s, x_m, y, z, t)
    	tmp = 0.0
    	if ((z <= -4.6e+46) || !(z <= 1.65e+82))
    		tmp = Float64(1.0 * x_m);
    	else
    		tmp = Float64(Float64(Float64(y - z) * x_m) / t);
    	end
    	return Float64(x_s * tmp)
    end
    
    x\_m = abs(x);
    x\_s = sign(x) * abs(1.0);
    function tmp_2 = code(x_s, x_m, y, z, t)
    	tmp = 0.0;
    	if ((z <= -4.6e+46) || ~((z <= 1.65e+82)))
    		tmp = 1.0 * x_m;
    	else
    		tmp = ((y - z) * x_m) / t;
    	end
    	tmp_2 = x_s * tmp;
    end
    
    x\_m = N[Abs[x], $MachinePrecision]
    x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -4.6e+46], N[Not[LessEqual[z, 1.65e+82]], $MachinePrecision]], N[(1.0 * x$95$m), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
    
    \begin{array}{l}
    x\_m = \left|x\right|
    \\
    x\_s = \mathsf{copysign}\left(1, x\right)
    
    \\
    x\_s \cdot \begin{array}{l}
    \mathbf{if}\;z \leq -4.6 \cdot 10^{+46} \lor \neg \left(z \leq 1.65 \cdot 10^{+82}\right):\\
    \;\;\;\;1 \cdot x\_m\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -4.6000000000000001e46 or 1.6499999999999999e82 < z

      1. Initial program 67.3%

        \[\frac{x \cdot \left(y - z\right)}{t - z} \]
      2. Add Preprocessing
      3. Taylor expanded in t around 0

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{y - z}{z}}\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{y - z}{z} \cdot x}\right) \]
        4. distribute-lft-neg-inN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
        5. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
        6. distribute-neg-fracN/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
        7. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
        8. *-lft-identityN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{1 \cdot z}\right)\right)}{z} \cdot x \]
        9. metadata-evalN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot z\right)\right)}{z} \cdot x \]
        10. fp-cancel-sign-sub-invN/A

          \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(y + -1 \cdot z\right)}\right)}{z} \cdot x \]
        11. +-commutativeN/A

          \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + y\right)}\right)}{z} \cdot x \]
        12. distribute-neg-inN/A

          \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}}{z} \cdot x \]
        13. mul-1-negN/A

          \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
        14. remove-double-negN/A

          \[\leadsto \frac{\color{blue}{z} + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
        15. mul-1-negN/A

          \[\leadsto \frac{z + \color{blue}{-1 \cdot y}}{z} \cdot x \]
        16. metadata-evalN/A

          \[\leadsto \frac{z + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)} \cdot y}{z} \cdot x \]
        17. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{\color{blue}{z - 1 \cdot y}}{z} \cdot x \]
        18. *-lft-identityN/A

          \[\leadsto \frac{z - \color{blue}{y}}{z} \cdot x \]
        19. lower--.f6481.8

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

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

        \[\leadsto 1 \cdot x \]
      7. Step-by-step derivation
        1. Applied rewrites68.6%

          \[\leadsto 1 \cdot x \]

        if -4.6000000000000001e46 < z < 1.6499999999999999e82

        1. Initial program 96.3%

          \[\frac{x \cdot \left(y - z\right)}{t - z} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t - z}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{x \cdot \left(y - z\right)}}{t - z} \]
          3. *-commutativeN/A

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

            \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{x}{t - z}} \]
          5. *-commutativeN/A

            \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
          6. lower-*.f64N/A

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

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

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

          \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t}} \]
        6. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{x \cdot \left(y - z\right)}{t}} \]
          2. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{t} \]
          3. lower-*.f64N/A

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

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

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

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

      Alternative 7: 61.3% accurate, 0.8× speedup?

      \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{+25} \lor \neg \left(z \leq 2.5 \cdot 10^{-25}\right):\\ \;\;\;\;1 \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \frac{y}{t}\\ \end{array} \end{array} \]
      x\_m = (fabs.f64 x)
      x\_s = (copysign.f64 #s(literal 1 binary64) x)
      (FPCore (x_s x_m y z t)
       :precision binary64
       (*
        x_s
        (if (or (<= z -3.9e+25) (not (<= z 2.5e-25))) (* 1.0 x_m) (* x_m (/ y t)))))
      x\_m = fabs(x);
      x\_s = copysign(1.0, x);
      double code(double x_s, double x_m, double y, double z, double t) {
      	double tmp;
      	if ((z <= -3.9e+25) || !(z <= 2.5e-25)) {
      		tmp = 1.0 * x_m;
      	} else {
      		tmp = x_m * (y / t);
      	}
      	return x_s * tmp;
      }
      
      x\_m = abs(x)
      x\_s = copysign(1.0d0, x)
      real(8) function code(x_s, x_m, y, z, t)
          real(8), intent (in) :: x_s
          real(8), intent (in) :: x_m
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: tmp
          if ((z <= (-3.9d+25)) .or. (.not. (z <= 2.5d-25))) then
              tmp = 1.0d0 * x_m
          else
              tmp = x_m * (y / t)
          end if
          code = x_s * tmp
      end function
      
      x\_m = Math.abs(x);
      x\_s = Math.copySign(1.0, x);
      public static double code(double x_s, double x_m, double y, double z, double t) {
      	double tmp;
      	if ((z <= -3.9e+25) || !(z <= 2.5e-25)) {
      		tmp = 1.0 * x_m;
      	} else {
      		tmp = x_m * (y / t);
      	}
      	return x_s * tmp;
      }
      
      x\_m = math.fabs(x)
      x\_s = math.copysign(1.0, x)
      def code(x_s, x_m, y, z, t):
      	tmp = 0
      	if (z <= -3.9e+25) or not (z <= 2.5e-25):
      		tmp = 1.0 * x_m
      	else:
      		tmp = x_m * (y / t)
      	return x_s * tmp
      
      x\_m = abs(x)
      x\_s = copysign(1.0, x)
      function code(x_s, x_m, y, z, t)
      	tmp = 0.0
      	if ((z <= -3.9e+25) || !(z <= 2.5e-25))
      		tmp = Float64(1.0 * x_m);
      	else
      		tmp = Float64(x_m * Float64(y / t));
      	end
      	return Float64(x_s * tmp)
      end
      
      x\_m = abs(x);
      x\_s = sign(x) * abs(1.0);
      function tmp_2 = code(x_s, x_m, y, z, t)
      	tmp = 0.0;
      	if ((z <= -3.9e+25) || ~((z <= 2.5e-25)))
      		tmp = 1.0 * x_m;
      	else
      		tmp = x_m * (y / t);
      	end
      	tmp_2 = x_s * tmp;
      end
      
      x\_m = N[Abs[x], $MachinePrecision]
      x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
      code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -3.9e+25], N[Not[LessEqual[z, 2.5e-25]], $MachinePrecision]], N[(1.0 * x$95$m), $MachinePrecision], N[(x$95$m * N[(y / t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
      
      \begin{array}{l}
      x\_m = \left|x\right|
      \\
      x\_s = \mathsf{copysign}\left(1, x\right)
      
      \\
      x\_s \cdot \begin{array}{l}
      \mathbf{if}\;z \leq -3.9 \cdot 10^{+25} \lor \neg \left(z \leq 2.5 \cdot 10^{-25}\right):\\
      \;\;\;\;1 \cdot x\_m\\
      
      \mathbf{else}:\\
      \;\;\;\;x\_m \cdot \frac{y}{t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -3.9000000000000002e25 or 2.49999999999999981e-25 < z

        1. Initial program 73.7%

          \[\frac{x \cdot \left(y - z\right)}{t - z} \]
        2. Add Preprocessing
        3. Taylor expanded in t around 0

          \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

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

            \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{y - z}{z}}\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{y - z}{z} \cdot x}\right) \]
          4. distribute-lft-neg-inN/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
          5. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
          6. distribute-neg-fracN/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
          7. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
          8. *-lft-identityN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{1 \cdot z}\right)\right)}{z} \cdot x \]
          9. metadata-evalN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot z\right)\right)}{z} \cdot x \]
          10. fp-cancel-sign-sub-invN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(y + -1 \cdot z\right)}\right)}{z} \cdot x \]
          11. +-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + y\right)}\right)}{z} \cdot x \]
          12. distribute-neg-inN/A

            \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}}{z} \cdot x \]
          13. mul-1-negN/A

            \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
          14. remove-double-negN/A

            \[\leadsto \frac{\color{blue}{z} + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
          15. mul-1-negN/A

            \[\leadsto \frac{z + \color{blue}{-1 \cdot y}}{z} \cdot x \]
          16. metadata-evalN/A

            \[\leadsto \frac{z + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)} \cdot y}{z} \cdot x \]
          17. fp-cancel-sub-sign-invN/A

            \[\leadsto \frac{\color{blue}{z - 1 \cdot y}}{z} \cdot x \]
          18. *-lft-identityN/A

            \[\leadsto \frac{z - \color{blue}{y}}{z} \cdot x \]
          19. lower--.f6476.4

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

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

          \[\leadsto 1 \cdot x \]
        7. Step-by-step derivation
          1. Applied rewrites62.2%

            \[\leadsto 1 \cdot x \]

          if -3.9000000000000002e25 < z < 2.49999999999999981e-25

          1. Initial program 96.3%

            \[\frac{x \cdot \left(y - z\right)}{t - z} \]
          2. Add Preprocessing
          3. Taylor expanded in z around 0

            \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
            2. *-commutativeN/A

              \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
            3. lower-*.f6469.5

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

            \[\leadsto \color{blue}{\frac{y \cdot x}{t}} \]
          6. Step-by-step derivation
            1. Applied rewrites70.2%

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

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

          Alternative 8: 35.1% accurate, 3.8× speedup?

          \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(1 \cdot x\_m\right) \end{array} \]
          x\_m = (fabs.f64 x)
          x\_s = (copysign.f64 #s(literal 1 binary64) x)
          (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* 1.0 x_m)))
          x\_m = fabs(x);
          x\_s = copysign(1.0, x);
          double code(double x_s, double x_m, double y, double z, double t) {
          	return x_s * (1.0 * x_m);
          }
          
          x\_m = abs(x)
          x\_s = copysign(1.0d0, x)
          real(8) function code(x_s, x_m, y, z, t)
              real(8), intent (in) :: x_s
              real(8), intent (in) :: x_m
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              code = x_s * (1.0d0 * x_m)
          end function
          
          x\_m = Math.abs(x);
          x\_s = Math.copySign(1.0, x);
          public static double code(double x_s, double x_m, double y, double z, double t) {
          	return x_s * (1.0 * x_m);
          }
          
          x\_m = math.fabs(x)
          x\_s = math.copysign(1.0, x)
          def code(x_s, x_m, y, z, t):
          	return x_s * (1.0 * x_m)
          
          x\_m = abs(x)
          x\_s = copysign(1.0, x)
          function code(x_s, x_m, y, z, t)
          	return Float64(x_s * Float64(1.0 * x_m))
          end
          
          x\_m = abs(x);
          x\_s = sign(x) * abs(1.0);
          function tmp = code(x_s, x_m, y, z, t)
          	tmp = x_s * (1.0 * x_m);
          end
          
          x\_m = N[Abs[x], $MachinePrecision]
          x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(1.0 * x$95$m), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          x\_m = \left|x\right|
          \\
          x\_s = \mathsf{copysign}\left(1, x\right)
          
          \\
          x\_s \cdot \left(1 \cdot x\_m\right)
          \end{array}
          
          Derivation
          1. Initial program 85.5%

            \[\frac{x \cdot \left(y - z\right)}{t - z} \]
          2. Add Preprocessing
          3. Taylor expanded in t around 0

            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \left(y - z\right)}{z}} \]
          4. Step-by-step derivation
            1. mul-1-negN/A

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

              \[\leadsto \mathsf{neg}\left(\color{blue}{x \cdot \frac{y - z}{z}}\right) \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{y - z}{z} \cdot x}\right) \]
            4. distribute-lft-neg-inN/A

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
            5. lower-*.f64N/A

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot x} \]
            6. distribute-neg-fracN/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
            7. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z}} \cdot x \]
            8. *-lft-identityN/A

              \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{1 \cdot z}\right)\right)}{z} \cdot x \]
            9. metadata-evalN/A

              \[\leadsto \frac{\mathsf{neg}\left(\left(y - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)} \cdot z\right)\right)}{z} \cdot x \]
            10. fp-cancel-sign-sub-invN/A

              \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(y + -1 \cdot z\right)}\right)}{z} \cdot x \]
            11. +-commutativeN/A

              \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(-1 \cdot z + y\right)}\right)}{z} \cdot x \]
            12. distribute-neg-inN/A

              \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}}{z} \cdot x \]
            13. mul-1-negN/A

              \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
            14. remove-double-negN/A

              \[\leadsto \frac{\color{blue}{z} + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
            15. mul-1-negN/A

              \[\leadsto \frac{z + \color{blue}{-1 \cdot y}}{z} \cdot x \]
            16. metadata-evalN/A

              \[\leadsto \frac{z + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)} \cdot y}{z} \cdot x \]
            17. fp-cancel-sub-sign-invN/A

              \[\leadsto \frac{\color{blue}{z - 1 \cdot y}}{z} \cdot x \]
            18. *-lft-identityN/A

              \[\leadsto \frac{z - \color{blue}{y}}{z} \cdot x \]
            19. lower--.f6450.1

              \[\leadsto \frac{\color{blue}{z - y}}{z} \cdot x \]
          5. Applied rewrites50.1%

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

            \[\leadsto 1 \cdot x \]
          7. Step-by-step derivation
            1. Applied rewrites34.7%

              \[\leadsto 1 \cdot x \]
            2. Final simplification34.7%

              \[\leadsto 1 \cdot x \]
            3. Add Preprocessing

            Developer Target 1: 97.0% accurate, 0.8× 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 2024338 
            (FPCore (x y z t)
              :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
              :precision binary64
            
              :alt
              (! :herbie-platform default (/ x (/ (- t z) (- y z))))
            
              (/ (* x (- y z)) (- t z)))