Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B

Percentage Accurate: 96.6% → 99.6%
Time: 30.5s
Alternatives: 21
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\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 21 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: 96.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}

Alternative 1: 99.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b)
	return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b)))))
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Derivation
  1. Initial program 95.7%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Step-by-step derivation
    1. fma-define95.7%

      \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
    2. sub-neg95.7%

      \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
    3. log1p-define99.2%

      \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
  3. Simplified99.2%

    \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
  4. Add Preprocessing
  5. Final simplification99.2%

    \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)} \]
  6. Add Preprocessing

Alternative 2: 96.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right) - y \cdot \left(t - \log z\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (- (* a (- (log (- 1.0 z)) b)) (* y (- t (log z)))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((a * (log((1.0 - z)) - b)) - (y * (t - log(z)))));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((a * (log((1.0d0 - z)) - b)) - (y * (t - log(z)))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((a * (Math.log((1.0 - z)) - b)) - (y * (t - Math.log(z)))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((a * (math.log((1.0 - z)) - b)) - (y * (t - math.log(z)))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(a * Float64(log(Float64(1.0 - z)) - b)) - Float64(y * Float64(t - log(z))))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((a * (log((1.0 - z)) - b)) - (y * (t - log(z)))));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] - N[(y * N[(t - N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right) - y \cdot \left(t - \log z\right)}
\end{array}
Derivation
  1. Initial program 95.7%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Add Preprocessing
  3. Final simplification95.7%

    \[\leadsto x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right) - y \cdot \left(t - \log z\right)} \]
  4. Add Preprocessing

Alternative 3: 87.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{-41} \lor \neg \left(y \leq 8.4 \cdot 10^{-19}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -1.45e-41) (not (<= y 8.4e-19)))
   (* x (exp (* y (- (log z) t))))
   (* x (exp (* (- a) (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -1.45e-41) || !(y <= 8.4e-19)) {
		tmp = x * exp((y * (log(z) - t)));
	} else {
		tmp = x * exp((-a * (z + b)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((y <= (-1.45d-41)) .or. (.not. (y <= 8.4d-19))) then
        tmp = x * exp((y * (log(z) - t)))
    else
        tmp = x * exp((-a * (z + b)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -1.45e-41) || !(y <= 8.4e-19)) {
		tmp = x * Math.exp((y * (Math.log(z) - t)));
	} else {
		tmp = x * Math.exp((-a * (z + b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -1.45e-41) or not (y <= 8.4e-19):
		tmp = x * math.exp((y * (math.log(z) - t)))
	else:
		tmp = x * math.exp((-a * (z + b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -1.45e-41) || !(y <= 8.4e-19))
		tmp = Float64(x * exp(Float64(y * Float64(log(z) - t))));
	else
		tmp = Float64(x * exp(Float64(Float64(-a) * Float64(z + b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -1.45e-41) || ~((y <= 8.4e-19)))
		tmp = x * exp((y * (log(z) - t)));
	else
		tmp = x * exp((-a * (z + b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.45e-41], N[Not[LessEqual[y, 8.4e-19]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-41} \lor \neg \left(y \leq 8.4 \cdot 10^{-19}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.44999999999999989e-41 or 8.3999999999999996e-19 < y

    1. Initial program 97.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 87.3%

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

    if -1.44999999999999989e-41 < y < 8.3999999999999996e-19

    1. Initial program 93.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 83.1%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg83.1%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define90.8%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified90.8%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 90.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b} + -1 \cdot \left(a \cdot z\right)} \]
      2. associate-*r*90.8%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot b + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      3. distribute-lft-out90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(b + z\right)}} \]
      4. mul-1-neg90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
    8. Simplified90.8%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{-41} \lor \neg \left(y \leq 8.4 \cdot 10^{-19}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 73.4% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ t_2 := x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{if}\;t \leq -2.45 \cdot 10^{+114}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -1.1 \cdot 10^{-285}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{-190}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+35}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (exp (* (- a) (+ z b))))) (t_2 (* x (exp (* y (- t))))))
   (if (<= t -2.45e+114)
     t_2
     (if (<= t -1.1e-285)
       t_1
       (if (<= t 2.9e-190) (* x (pow z y)) (if (<= t 5.8e+35) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * exp((-a * (z + b)));
	double t_2 = x * exp((y * -t));
	double tmp;
	if (t <= -2.45e+114) {
		tmp = t_2;
	} else if (t <= -1.1e-285) {
		tmp = t_1;
	} else if (t <= 2.9e-190) {
		tmp = x * pow(z, y);
	} else if (t <= 5.8e+35) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * exp((-a * (z + b)))
    t_2 = x * exp((y * -t))
    if (t <= (-2.45d+114)) then
        tmp = t_2
    else if (t <= (-1.1d-285)) then
        tmp = t_1
    else if (t <= 2.9d-190) then
        tmp = x * (z ** y)
    else if (t <= 5.8d+35) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * Math.exp((-a * (z + b)));
	double t_2 = x * Math.exp((y * -t));
	double tmp;
	if (t <= -2.45e+114) {
		tmp = t_2;
	} else if (t <= -1.1e-285) {
		tmp = t_1;
	} else if (t <= 2.9e-190) {
		tmp = x * Math.pow(z, y);
	} else if (t <= 5.8e+35) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.exp((-a * (z + b)))
	t_2 = x * math.exp((y * -t))
	tmp = 0
	if t <= -2.45e+114:
		tmp = t_2
	elif t <= -1.1e-285:
		tmp = t_1
	elif t <= 2.9e-190:
		tmp = x * math.pow(z, y)
	elif t <= 5.8e+35:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * exp(Float64(Float64(-a) * Float64(z + b))))
	t_2 = Float64(x * exp(Float64(y * Float64(-t))))
	tmp = 0.0
	if (t <= -2.45e+114)
		tmp = t_2;
	elseif (t <= -1.1e-285)
		tmp = t_1;
	elseif (t <= 2.9e-190)
		tmp = Float64(x * (z ^ y));
	elseif (t <= 5.8e+35)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * exp((-a * (z + b)));
	t_2 = x * exp((y * -t));
	tmp = 0.0;
	if (t <= -2.45e+114)
		tmp = t_2;
	elseif (t <= -1.1e-285)
		tmp = t_1;
	elseif (t <= 2.9e-190)
		tmp = x * (z ^ y);
	elseif (t <= 5.8e+35)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.45e+114], t$95$2, If[LessEqual[t, -1.1e-285], t$95$1, If[LessEqual[t, 2.9e-190], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e+35], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
t_2 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;t \leq -2.45 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -1.1 \cdot 10^{-285}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 5.8 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.45e114 or 5.79999999999999989e35 < t

    1. Initial program 95.5%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 83.0%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg83.0%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out83.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative83.0%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified83.0%

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

    if -2.45e114 < t < -1.1e-285 or 2.9000000000000002e-190 < t < 5.79999999999999989e35

    1. Initial program 95.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 73.8%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg73.8%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define79.8%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified79.8%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 79.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*79.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b} + -1 \cdot \left(a \cdot z\right)} \]
      2. associate-*r*79.8%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot b + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      3. distribute-lft-out79.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(b + z\right)}} \]
      4. mul-1-neg79.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
    8. Simplified79.8%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]

    if -1.1e-285 < t < 2.9000000000000002e-190

    1. Initial program 96.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 82.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.45 \cdot 10^{+114}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq -1.1 \cdot 10^{-285}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{-190}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+35}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 70.9% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{if}\;t \leq -1.95 \cdot 10^{+116}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{-285}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-89}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (exp (* y (- t))))))
   (if (<= t -1.95e+116)
     t_1
     (if (<= t -1.5e-285)
       (* x (exp (* a (- b))))
       (if (<= t 5.5e-89) (* x (pow z y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * exp((y * -t));
	double tmp;
	if (t <= -1.95e+116) {
		tmp = t_1;
	} else if (t <= -1.5e-285) {
		tmp = x * exp((a * -b));
	} else if (t <= 5.5e-89) {
		tmp = x * pow(z, y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * exp((y * -t))
    if (t <= (-1.95d+116)) then
        tmp = t_1
    else if (t <= (-1.5d-285)) then
        tmp = x * exp((a * -b))
    else if (t <= 5.5d-89) then
        tmp = x * (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 a, double b) {
	double t_1 = x * Math.exp((y * -t));
	double tmp;
	if (t <= -1.95e+116) {
		tmp = t_1;
	} else if (t <= -1.5e-285) {
		tmp = x * Math.exp((a * -b));
	} else if (t <= 5.5e-89) {
		tmp = x * Math.pow(z, y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.exp((y * -t))
	tmp = 0
	if t <= -1.95e+116:
		tmp = t_1
	elif t <= -1.5e-285:
		tmp = x * math.exp((a * -b))
	elif t <= 5.5e-89:
		tmp = x * math.pow(z, y)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * exp(Float64(y * Float64(-t))))
	tmp = 0.0
	if (t <= -1.95e+116)
		tmp = t_1;
	elseif (t <= -1.5e-285)
		tmp = Float64(x * exp(Float64(a * Float64(-b))));
	elseif (t <= 5.5e-89)
		tmp = Float64(x * (z ^ y));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * exp((y * -t));
	tmp = 0.0;
	if (t <= -1.95e+116)
		tmp = t_1;
	elseif (t <= -1.5e-285)
		tmp = x * exp((a * -b));
	elseif (t <= 5.5e-89)
		tmp = x * (z ^ y);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.95e+116], t$95$1, If[LessEqual[t, -1.5e-285], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-89], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;t \leq -1.95 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.5 \cdot 10^{-285}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.95000000000000016e116 or 5.50000000000000012e-89 < t

    1. Initial program 94.7%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 79.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg79.6%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out79.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative79.6%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified79.6%

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

    if -1.95000000000000016e116 < t < -1.50000000000000002e-285

    1. Initial program 96.9%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf 79.1%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg79.1%

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out79.1%

        \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]
    5. Simplified79.1%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]

    if -1.50000000000000002e-285 < t < 5.50000000000000012e-89

    1. Initial program 96.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 73.8%

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

      \[\leadsto x \cdot \color{blue}{{z}^{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification78.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.95 \cdot 10^{+116}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{-285}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-89}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.8% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -55000000000000 \lor \neg \left(y \leq 8.4 \cdot 10^{-19}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -55000000000000.0) (not (<= y 8.4e-19)))
   (* x (pow z y))
   (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -55000000000000.0) || !(y <= 8.4e-19)) {
		tmp = x * pow(z, y);
	} else {
		tmp = x * exp((a * -b));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((y <= (-55000000000000.0d0)) .or. (.not. (y <= 8.4d-19))) then
        tmp = x * (z ** y)
    else
        tmp = x * exp((a * -b))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -55000000000000.0) || !(y <= 8.4e-19)) {
		tmp = x * Math.pow(z, y);
	} else {
		tmp = x * Math.exp((a * -b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -55000000000000.0) or not (y <= 8.4e-19):
		tmp = x * math.pow(z, y)
	else:
		tmp = x * math.exp((a * -b))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -55000000000000.0) || !(y <= 8.4e-19))
		tmp = Float64(x * (z ^ y));
	else
		tmp = Float64(x * exp(Float64(a * Float64(-b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -55000000000000.0) || ~((y <= 8.4e-19)))
		tmp = x * (z ^ y);
	else
		tmp = x * exp((a * -b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -55000000000000.0], N[Not[LessEqual[y, 8.4e-19]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -55000000000000 \lor \neg \left(y \leq 8.4 \cdot 10^{-19}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.5e13 or 8.3999999999999996e-19 < y

    1. Initial program 97.1%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 89.9%

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

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

    if -5.5e13 < y < 8.3999999999999996e-19

    1. Initial program 94.1%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf 79.9%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg79.9%

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out79.9%

        \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]
    5. Simplified79.9%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -55000000000000 \lor \neg \left(y \leq 8.4 \cdot 10^{-19}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 55.4% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.1 \cdot 10^{+41}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -5.1e+41) (* x (- 1.0 (* y t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -5.1e+41) {
		tmp = x * (1.0 - (y * t));
	} else {
		tmp = x * pow(z, y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (t <= (-5.1d+41)) then
        tmp = x * (1.0d0 - (y * t))
    else
        tmp = x * (z ** y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -5.1e+41) {
		tmp = x * (1.0 - (y * t));
	} else {
		tmp = x * Math.pow(z, y);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -5.1e+41:
		tmp = x * (1.0 - (y * t))
	else:
		tmp = x * math.pow(z, y)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -5.1e+41)
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	else
		tmp = Float64(x * (z ^ y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -5.1e+41)
		tmp = x * (1.0 - (y * t));
	else
		tmp = x * (z ^ y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5.1e+41], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{+41}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.09999999999999978e41

    1. Initial program 93.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 79.7%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg79.7%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out79.7%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative79.7%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified79.7%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 36.3%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg36.3%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg36.3%

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

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

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

    if -5.09999999999999978e41 < t

    1. Initial program 96.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 71.0%

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

      \[\leadsto x \cdot \color{blue}{{z}^{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.1 \cdot 10^{+41}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 33.7% accurate, 9.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.8 \cdot 10^{+40}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-178}:\\ \;\;\;\;x \cdot \left(1 - z \cdot \left(a + a \cdot \frac{b}{z}\right)\right)\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-111}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;t \leq 7.6 \cdot 10^{+158}:\\ \;\;\;\;x + b \cdot \left(a \cdot \left(\left(a \cdot 0.5\right) \cdot \left(x \cdot b\right) - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -4.8e+40)
   (* x (- 1.0 (* y t)))
   (if (<= t 2.7e-178)
     (* x (- 1.0 (* z (+ a (* a (/ b z))))))
     (if (<= t 8.2e-111)
       (* x (* y t))
       (if (<= t 7.6e+158)
         (+ x (* b (* a (- (* (* a 0.5) (* x b)) x))))
         (* t (* y (- x))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -4.8e+40) {
		tmp = x * (1.0 - (y * t));
	} else if (t <= 2.7e-178) {
		tmp = x * (1.0 - (z * (a + (a * (b / z)))));
	} else if (t <= 8.2e-111) {
		tmp = x * (y * t);
	} else if (t <= 7.6e+158) {
		tmp = x + (b * (a * (((a * 0.5) * (x * b)) - x)));
	} else {
		tmp = t * (y * -x);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (t <= (-4.8d+40)) then
        tmp = x * (1.0d0 - (y * t))
    else if (t <= 2.7d-178) then
        tmp = x * (1.0d0 - (z * (a + (a * (b / z)))))
    else if (t <= 8.2d-111) then
        tmp = x * (y * t)
    else if (t <= 7.6d+158) then
        tmp = x + (b * (a * (((a * 0.5d0) * (x * b)) - x)))
    else
        tmp = t * (y * -x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -4.8e+40) {
		tmp = x * (1.0 - (y * t));
	} else if (t <= 2.7e-178) {
		tmp = x * (1.0 - (z * (a + (a * (b / z)))));
	} else if (t <= 8.2e-111) {
		tmp = x * (y * t);
	} else if (t <= 7.6e+158) {
		tmp = x + (b * (a * (((a * 0.5) * (x * b)) - x)));
	} else {
		tmp = t * (y * -x);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -4.8e+40:
		tmp = x * (1.0 - (y * t))
	elif t <= 2.7e-178:
		tmp = x * (1.0 - (z * (a + (a * (b / z)))))
	elif t <= 8.2e-111:
		tmp = x * (y * t)
	elif t <= 7.6e+158:
		tmp = x + (b * (a * (((a * 0.5) * (x * b)) - x)))
	else:
		tmp = t * (y * -x)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -4.8e+40)
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	elseif (t <= 2.7e-178)
		tmp = Float64(x * Float64(1.0 - Float64(z * Float64(a + Float64(a * Float64(b / z))))));
	elseif (t <= 8.2e-111)
		tmp = Float64(x * Float64(y * t));
	elseif (t <= 7.6e+158)
		tmp = Float64(x + Float64(b * Float64(a * Float64(Float64(Float64(a * 0.5) * Float64(x * b)) - x))));
	else
		tmp = Float64(t * Float64(y * Float64(-x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -4.8e+40)
		tmp = x * (1.0 - (y * t));
	elseif (t <= 2.7e-178)
		tmp = x * (1.0 - (z * (a + (a * (b / z)))));
	elseif (t <= 8.2e-111)
		tmp = x * (y * t);
	elseif (t <= 7.6e+158)
		tmp = x + (b * (a * (((a * 0.5) * (x * b)) - x)));
	else
		tmp = t * (y * -x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.8e+40], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e-178], N[(x * N[(1.0 - N[(z * N[(a + N[(a * N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.2e-111], N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.6e+158], N[(x + N[(b * N[(a * N[(N[(N[(a * 0.5), $MachinePrecision] * N[(x * b), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * (-x)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+40}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{elif}\;t \leq 2.7 \cdot 10^{-178}:\\
\;\;\;\;x \cdot \left(1 - z \cdot \left(a + a \cdot \frac{b}{z}\right)\right)\\

\mathbf{elif}\;t \leq 8.2 \cdot 10^{-111}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\

\mathbf{elif}\;t \leq 7.6 \cdot 10^{+158}:\\
\;\;\;\;x + b \cdot \left(a \cdot \left(\left(a \cdot 0.5\right) \cdot \left(x \cdot b\right) - x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -4.8e40

    1. Initial program 93.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 79.7%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg79.7%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out79.7%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative79.7%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified79.7%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 36.3%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg36.3%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg36.3%

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

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

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

    if -4.8e40 < t < 2.70000000000000009e-178

    1. Initial program 96.5%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 74.2%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg74.2%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define77.6%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified77.6%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 77.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*77.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b} + -1 \cdot \left(a \cdot z\right)} \]
      2. associate-*r*77.6%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot b + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      3. distribute-lft-out77.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(b + z\right)}} \]
      4. mul-1-neg77.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
    8. Simplified77.6%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
    9. Taylor expanded in a around 0 34.6%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. neg-mul-134.6%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot \left(b + z\right)\right)}\right) \]
      2. distribute-rgt-neg-in34.6%

        \[\leadsto x \cdot \left(1 + \color{blue}{a \cdot \left(-\left(b + z\right)\right)}\right) \]
    11. Simplified34.6%

      \[\leadsto x \cdot \color{blue}{\left(1 + a \cdot \left(-\left(b + z\right)\right)\right)} \]
    12. Taylor expanded in z around inf 44.8%

      \[\leadsto x \cdot \left(1 + \color{blue}{z \cdot \left(-1 \cdot a + -1 \cdot \frac{a \cdot b}{z}\right)}\right) \]
    13. Step-by-step derivation
      1. distribute-lft-out44.8%

        \[\leadsto x \cdot \left(1 + z \cdot \color{blue}{\left(-1 \cdot \left(a + \frac{a \cdot b}{z}\right)\right)}\right) \]
      2. associate-/l*48.8%

        \[\leadsto x \cdot \left(1 + z \cdot \left(-1 \cdot \left(a + \color{blue}{a \cdot \frac{b}{z}}\right)\right)\right) \]
    14. Simplified48.8%

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

    if 2.70000000000000009e-178 < t < 8.19999999999999936e-111

    1. Initial program 94.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 23.9%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg23.9%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out23.9%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative23.9%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified23.9%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 18.7%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg18.7%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg18.7%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified18.7%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg40.5%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. distribute-rgt-neg-out40.5%

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in40.5%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified40.5%

      \[\leadsto \color{blue}{t \cdot \left(x \cdot \left(-y\right)\right)} \]
    12. Step-by-step derivation
      1. pow140.5%

        \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot \left(-y\right)\right)\right)}^{1}} \]
      2. add-sqr-sqrt27.3%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}\right)\right)}^{1} \]
      3. sqrt-unprod55.9%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)\right)}^{1} \]
      4. sqr-neg55.9%

        \[\leadsto {\left(t \cdot \left(x \cdot \sqrt{\color{blue}{y \cdot y}}\right)\right)}^{1} \]
      5. sqrt-unprod18.5%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}\right)\right)}^{1} \]
      6. add-sqr-sqrt40.2%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{y}\right)\right)}^{1} \]
    13. Applied egg-rr40.2%

      \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot y\right)\right)}^{1}} \]
    14. Step-by-step derivation
      1. unpow140.2%

        \[\leadsto \color{blue}{t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*40.2%

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

        \[\leadsto \color{blue}{\left(x \cdot t\right)} \cdot y \]
      4. associate-*r*45.3%

        \[\leadsto \color{blue}{x \cdot \left(t \cdot y\right)} \]
    15. Simplified45.3%

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

    if 8.19999999999999936e-111 < t < 7.5999999999999997e158

    1. Initial program 96.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf 64.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg64.6%

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out64.6%

        \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]
    5. Simplified64.6%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]
    6. Taylor expanded in b around 0 40.5%

      \[\leadsto \color{blue}{x + b \cdot \left(-1 \cdot \left(a \cdot x\right) + 0.5 \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right)\right)} \]
    7. Step-by-step derivation
      1. +-commutative40.5%

        \[\leadsto x + b \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right) + -1 \cdot \left(a \cdot x\right)\right)} \]
      2. mul-1-neg40.5%

        \[\leadsto x + b \cdot \left(0.5 \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right) + \color{blue}{\left(-a \cdot x\right)}\right) \]
      3. unsub-neg40.5%

        \[\leadsto x + b \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right) - a \cdot x\right)} \]
    8. Simplified40.5%

      \[\leadsto \color{blue}{x + b \cdot \left(0.5 \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right) - a \cdot x\right)} \]
    9. Taylor expanded in a around 0 46.8%

      \[\leadsto x + b \cdot \color{blue}{\left(a \cdot \left(0.5 \cdot \left(a \cdot \left(b \cdot x\right)\right) - x\right)\right)} \]
    10. Step-by-step derivation
      1. associate-*r*46.8%

        \[\leadsto x + b \cdot \left(a \cdot \left(\color{blue}{\left(0.5 \cdot a\right) \cdot \left(b \cdot x\right)} - x\right)\right) \]
    11. Simplified46.8%

      \[\leadsto x + b \cdot \color{blue}{\left(a \cdot \left(\left(0.5 \cdot a\right) \cdot \left(b \cdot x\right) - x\right)\right)} \]

    if 7.5999999999999997e158 < t

    1. Initial program 97.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 82.5%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg82.5%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out82.5%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative82.5%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified82.5%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 23.5%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg23.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg23.5%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified23.5%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg32.0%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. distribute-rgt-neg-out32.0%

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in32.0%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified32.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.8 \cdot 10^{+40}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-178}:\\ \;\;\;\;x \cdot \left(1 - z \cdot \left(a + a \cdot \frac{b}{z}\right)\right)\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-111}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;t \leq 7.6 \cdot 10^{+158}:\\ \;\;\;\;x + b \cdot \left(a \cdot \left(\left(a \cdot 0.5\right) \cdot \left(x \cdot b\right) - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 33.4% accurate, 9.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(z \cdot \left(\frac{1 - a \cdot b}{z} - a\right)\right)\\ \mathbf{if}\;t \leq -7.4 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-180}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-109}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (* z (- (/ (- 1.0 (* a b)) z) a)))))
   (if (<= t -7.4e+39)
     (* x (- 1.0 (* y t)))
     (if (<= t 2.1e-180)
       t_1
       (if (<= t 4.6e-109)
         (* x (* y t))
         (if (<= t 7.2e+154) t_1 (* t (* y (- x)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * (z * (((1.0 - (a * b)) / z) - a));
	double tmp;
	if (t <= -7.4e+39) {
		tmp = x * (1.0 - (y * t));
	} else if (t <= 2.1e-180) {
		tmp = t_1;
	} else if (t <= 4.6e-109) {
		tmp = x * (y * t);
	} else if (t <= 7.2e+154) {
		tmp = t_1;
	} else {
		tmp = t * (y * -x);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (z * (((1.0d0 - (a * b)) / z) - a))
    if (t <= (-7.4d+39)) then
        tmp = x * (1.0d0 - (y * t))
    else if (t <= 2.1d-180) then
        tmp = t_1
    else if (t <= 4.6d-109) then
        tmp = x * (y * t)
    else if (t <= 7.2d+154) then
        tmp = t_1
    else
        tmp = t * (y * -x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * (z * (((1.0 - (a * b)) / z) - a));
	double tmp;
	if (t <= -7.4e+39) {
		tmp = x * (1.0 - (y * t));
	} else if (t <= 2.1e-180) {
		tmp = t_1;
	} else if (t <= 4.6e-109) {
		tmp = x * (y * t);
	} else if (t <= 7.2e+154) {
		tmp = t_1;
	} else {
		tmp = t * (y * -x);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * (z * (((1.0 - (a * b)) / z) - a))
	tmp = 0
	if t <= -7.4e+39:
		tmp = x * (1.0 - (y * t))
	elif t <= 2.1e-180:
		tmp = t_1
	elif t <= 4.6e-109:
		tmp = x * (y * t)
	elif t <= 7.2e+154:
		tmp = t_1
	else:
		tmp = t * (y * -x)
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * Float64(z * Float64(Float64(Float64(1.0 - Float64(a * b)) / z) - a)))
	tmp = 0.0
	if (t <= -7.4e+39)
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	elseif (t <= 2.1e-180)
		tmp = t_1;
	elseif (t <= 4.6e-109)
		tmp = Float64(x * Float64(y * t));
	elseif (t <= 7.2e+154)
		tmp = t_1;
	else
		tmp = Float64(t * Float64(y * Float64(-x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * (z * (((1.0 - (a * b)) / z) - a));
	tmp = 0.0;
	if (t <= -7.4e+39)
		tmp = x * (1.0 - (y * t));
	elseif (t <= 2.1e-180)
		tmp = t_1;
	elseif (t <= 4.6e-109)
		tmp = x * (y * t);
	elseif (t <= 7.2e+154)
		tmp = t_1;
	else
		tmp = t * (y * -x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(z * N[(N[(N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.4e+39], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e-180], t$95$1, If[LessEqual[t, 4.6e-109], N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+154], t$95$1, N[(t * N[(y * (-x)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(z \cdot \left(\frac{1 - a \cdot b}{z} - a\right)\right)\\
\mathbf{if}\;t \leq -7.4 \cdot 10^{+39}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{elif}\;t \leq 2.1 \cdot 10^{-180}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4.6 \cdot 10^{-109}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\

\mathbf{elif}\;t \leq 7.2 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -7.40000000000000025e39

    1. Initial program 93.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 79.7%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg79.7%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out79.7%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative79.7%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified79.7%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 36.3%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg36.3%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg36.3%

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

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

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

    if -7.40000000000000025e39 < t < 2.0999999999999999e-180 or 4.6000000000000003e-109 < t < 7.2000000000000001e154

    1. Initial program 96.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 71.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg71.3%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define75.0%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified75.0%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 75.0%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*75.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b} + -1 \cdot \left(a \cdot z\right)} \]
      2. associate-*r*75.0%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot b + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      3. distribute-lft-out75.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(b + z\right)}} \]
      4. mul-1-neg75.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
    8. Simplified75.0%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
    9. Taylor expanded in a around 0 35.0%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. neg-mul-135.0%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot \left(b + z\right)\right)}\right) \]
      2. distribute-rgt-neg-in35.0%

        \[\leadsto x \cdot \left(1 + \color{blue}{a \cdot \left(-\left(b + z\right)\right)}\right) \]
    11. Simplified35.0%

      \[\leadsto x \cdot \color{blue}{\left(1 + a \cdot \left(-\left(b + z\right)\right)\right)} \]
    12. Taylor expanded in z around -inf 43.0%

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(z \cdot \left(a + -1 \cdot \frac{1 + -1 \cdot \left(a \cdot b\right)}{z}\right)\right)\right)} \]
    13. Step-by-step derivation
      1. mul-1-neg43.0%

        \[\leadsto x \cdot \color{blue}{\left(-z \cdot \left(a + -1 \cdot \frac{1 + -1 \cdot \left(a \cdot b\right)}{z}\right)\right)} \]
      2. *-commutative43.0%

        \[\leadsto x \cdot \left(-\color{blue}{\left(a + -1 \cdot \frac{1 + -1 \cdot \left(a \cdot b\right)}{z}\right) \cdot z}\right) \]
      3. distribute-rgt-neg-in43.0%

        \[\leadsto x \cdot \color{blue}{\left(\left(a + -1 \cdot \frac{1 + -1 \cdot \left(a \cdot b\right)}{z}\right) \cdot \left(-z\right)\right)} \]
      4. mul-1-neg43.0%

        \[\leadsto x \cdot \left(\left(a + \color{blue}{\left(-\frac{1 + -1 \cdot \left(a \cdot b\right)}{z}\right)}\right) \cdot \left(-z\right)\right) \]
      5. unsub-neg43.0%

        \[\leadsto x \cdot \left(\color{blue}{\left(a - \frac{1 + -1 \cdot \left(a \cdot b\right)}{z}\right)} \cdot \left(-z\right)\right) \]
      6. mul-1-neg43.0%

        \[\leadsto x \cdot \left(\left(a - \frac{1 + \color{blue}{\left(-a \cdot b\right)}}{z}\right) \cdot \left(-z\right)\right) \]
      7. unsub-neg43.0%

        \[\leadsto x \cdot \left(\left(a - \frac{\color{blue}{1 - a \cdot b}}{z}\right) \cdot \left(-z\right)\right) \]
    14. Simplified43.0%

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

    if 2.0999999999999999e-180 < t < 4.6000000000000003e-109

    1. Initial program 94.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 23.9%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg23.9%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out23.9%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative23.9%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified23.9%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 18.7%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg18.7%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg18.7%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified18.7%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg40.5%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. distribute-rgt-neg-out40.5%

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in40.5%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified40.5%

      \[\leadsto \color{blue}{t \cdot \left(x \cdot \left(-y\right)\right)} \]
    12. Step-by-step derivation
      1. pow140.5%

        \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot \left(-y\right)\right)\right)}^{1}} \]
      2. add-sqr-sqrt27.3%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}\right)\right)}^{1} \]
      3. sqrt-unprod55.9%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)\right)}^{1} \]
      4. sqr-neg55.9%

        \[\leadsto {\left(t \cdot \left(x \cdot \sqrt{\color{blue}{y \cdot y}}\right)\right)}^{1} \]
      5. sqrt-unprod18.5%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}\right)\right)}^{1} \]
      6. add-sqr-sqrt40.2%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{y}\right)\right)}^{1} \]
    13. Applied egg-rr40.2%

      \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot y\right)\right)}^{1}} \]
    14. Step-by-step derivation
      1. unpow140.2%

        \[\leadsto \color{blue}{t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*40.2%

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

        \[\leadsto \color{blue}{\left(x \cdot t\right)} \cdot y \]
      4. associate-*r*45.3%

        \[\leadsto \color{blue}{x \cdot \left(t \cdot y\right)} \]
    15. Simplified45.3%

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

    if 7.2000000000000001e154 < t

    1. Initial program 97.1%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 83.0%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg83.0%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out83.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative83.0%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified83.0%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 23.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg23.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg23.0%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified23.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg31.2%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. distribute-rgt-neg-out31.2%

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in31.2%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified31.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.4 \cdot 10^{+39}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-180}:\\ \;\;\;\;x \cdot \left(z \cdot \left(\frac{1 - a \cdot b}{z} - a\right)\right)\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-109}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \left(z \cdot \left(\frac{1 - a \cdot b}{z} - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 33.6% accurate, 9.5× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - z \cdot \left(a + a \cdot \frac{b}{z}\right)\right)\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+43}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{elif}\;t \leq 2.45 \cdot 10^{-179}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 8.2 \cdot 10^{-111}:\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\

\mathbf{elif}\;t \leq 7.5 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.80000000000000005e43

    1. Initial program 93.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 79.7%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg79.7%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out79.7%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative79.7%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified79.7%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 36.3%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg36.3%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg36.3%

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

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

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

    if -1.80000000000000005e43 < t < 2.45e-179 or 8.19999999999999936e-111 < t < 7.5000000000000004e154

    1. Initial program 96.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 71.3%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg71.3%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define75.0%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified75.0%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 75.0%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*75.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b} + -1 \cdot \left(a \cdot z\right)} \]
      2. associate-*r*75.0%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot b + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      3. distribute-lft-out75.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(b + z\right)}} \]
      4. mul-1-neg75.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
    8. Simplified75.0%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
    9. Taylor expanded in a around 0 35.0%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. neg-mul-135.0%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot \left(b + z\right)\right)}\right) \]
      2. distribute-rgt-neg-in35.0%

        \[\leadsto x \cdot \left(1 + \color{blue}{a \cdot \left(-\left(b + z\right)\right)}\right) \]
    11. Simplified35.0%

      \[\leadsto x \cdot \color{blue}{\left(1 + a \cdot \left(-\left(b + z\right)\right)\right)} \]
    12. Taylor expanded in z around inf 43.1%

      \[\leadsto x \cdot \left(1 + \color{blue}{z \cdot \left(-1 \cdot a + -1 \cdot \frac{a \cdot b}{z}\right)}\right) \]
    13. Step-by-step derivation
      1. distribute-lft-out43.1%

        \[\leadsto x \cdot \left(1 + z \cdot \color{blue}{\left(-1 \cdot \left(a + \frac{a \cdot b}{z}\right)\right)}\right) \]
      2. associate-/l*47.0%

        \[\leadsto x \cdot \left(1 + z \cdot \left(-1 \cdot \left(a + \color{blue}{a \cdot \frac{b}{z}}\right)\right)\right) \]
    14. Simplified47.0%

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

    if 2.45e-179 < t < 8.19999999999999936e-111

    1. Initial program 94.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 23.9%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg23.9%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out23.9%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative23.9%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified23.9%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 18.7%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg18.7%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg18.7%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified18.7%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg40.5%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. distribute-rgt-neg-out40.5%

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in40.5%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified40.5%

      \[\leadsto \color{blue}{t \cdot \left(x \cdot \left(-y\right)\right)} \]
    12. Step-by-step derivation
      1. pow140.5%

        \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot \left(-y\right)\right)\right)}^{1}} \]
      2. add-sqr-sqrt27.3%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}\right)\right)}^{1} \]
      3. sqrt-unprod55.9%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)\right)}^{1} \]
      4. sqr-neg55.9%

        \[\leadsto {\left(t \cdot \left(x \cdot \sqrt{\color{blue}{y \cdot y}}\right)\right)}^{1} \]
      5. sqrt-unprod18.5%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}\right)\right)}^{1} \]
      6. add-sqr-sqrt40.2%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{y}\right)\right)}^{1} \]
    13. Applied egg-rr40.2%

      \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot y\right)\right)}^{1}} \]
    14. Step-by-step derivation
      1. unpow140.2%

        \[\leadsto \color{blue}{t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*40.2%

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

        \[\leadsto \color{blue}{\left(x \cdot t\right)} \cdot y \]
      4. associate-*r*45.3%

        \[\leadsto \color{blue}{x \cdot \left(t \cdot y\right)} \]
    15. Simplified45.3%

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

    if 7.5000000000000004e154 < t

    1. Initial program 97.1%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 83.0%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg83.0%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out83.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative83.0%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified83.0%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 23.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg23.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg23.0%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified23.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg31.2%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. distribute-rgt-neg-out31.2%

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in31.2%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified31.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+43}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;t \leq 2.45 \cdot 10^{-179}:\\ \;\;\;\;x \cdot \left(1 - z \cdot \left(a + a \cdot \frac{b}{z}\right)\right)\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-111}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \left(1 - z \cdot \left(a + a \cdot \frac{b}{z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 34.3% accurate, 13.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{-42}:\\
\;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\

\mathbf{elif}\;y \leq 0.0135:\\
\;\;\;\;x \cdot \left(b \cdot \left(\frac{1 - z \cdot a}{b} - a\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.3000000000000001e-42

    1. Initial program 98.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 57.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg57.6%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out57.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative57.6%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified57.6%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 26.5%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg26.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg26.5%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified26.5%

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

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

    if -4.3000000000000001e-42 < y < 0.0134999999999999998

    1. Initial program 93.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 83.1%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg83.1%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define90.8%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified90.8%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 90.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b} + -1 \cdot \left(a \cdot z\right)} \]
      2. associate-*r*90.8%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot b + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      3. distribute-lft-out90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(b + z\right)}} \]
      4. mul-1-neg90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
    8. Simplified90.8%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
    9. Taylor expanded in a around 0 47.5%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. neg-mul-147.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot \left(b + z\right)\right)}\right) \]
      2. distribute-rgt-neg-in47.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{a \cdot \left(-\left(b + z\right)\right)}\right) \]
    11. Simplified47.5%

      \[\leadsto x \cdot \color{blue}{\left(1 + a \cdot \left(-\left(b + z\right)\right)\right)} \]
    12. Taylor expanded in b around -inf 50.1%

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(b \cdot \left(a + -1 \cdot \frac{1 + -1 \cdot \left(a \cdot z\right)}{b}\right)\right)\right)} \]
    13. Step-by-step derivation
      1. mul-1-neg50.1%

        \[\leadsto x \cdot \color{blue}{\left(-b \cdot \left(a + -1 \cdot \frac{1 + -1 \cdot \left(a \cdot z\right)}{b}\right)\right)} \]
      2. distribute-rgt-neg-in50.1%

        \[\leadsto x \cdot \color{blue}{\left(b \cdot \left(-\left(a + -1 \cdot \frac{1 + -1 \cdot \left(a \cdot z\right)}{b}\right)\right)\right)} \]
      3. mul-1-neg50.1%

        \[\leadsto x \cdot \left(b \cdot \left(-\left(a + \color{blue}{\left(-\frac{1 + -1 \cdot \left(a \cdot z\right)}{b}\right)}\right)\right)\right) \]
      4. unsub-neg50.1%

        \[\leadsto x \cdot \left(b \cdot \left(-\color{blue}{\left(a - \frac{1 + -1 \cdot \left(a \cdot z\right)}{b}\right)}\right)\right) \]
      5. mul-1-neg50.1%

        \[\leadsto x \cdot \left(b \cdot \left(-\left(a - \frac{1 + \color{blue}{\left(-a \cdot z\right)}}{b}\right)\right)\right) \]
      6. unsub-neg50.1%

        \[\leadsto x \cdot \left(b \cdot \left(-\left(a - \frac{\color{blue}{1 - a \cdot z}}{b}\right)\right)\right) \]
    14. Simplified50.1%

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

    if 0.0134999999999999998 < y

    1. Initial program 96.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 59.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg59.8%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out59.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative59.8%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified59.8%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 22.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg22.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg22.0%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified22.0%

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

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

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

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

        \[\leadsto \color{blue}{-x \cdot \left(y \cdot t\right)} \]
      4. distribute-rgt-neg-in31.2%

        \[\leadsto \color{blue}{x \cdot \left(-y \cdot t\right)} \]
      5. *-commutative31.2%

        \[\leadsto x \cdot \left(-\color{blue}{t \cdot y}\right) \]
      6. distribute-rgt-neg-in31.2%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \left(-y\right)\right)} \]
    11. Simplified31.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.3 \cdot 10^{-42}:\\ \;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\ \mathbf{elif}\;y \leq 0.0135:\\ \;\;\;\;x \cdot \left(b \cdot \left(\frac{1 - z \cdot a}{b} - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 32.9% accurate, 16.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.16 \cdot 10^{-42}:\\
\;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{-5}:\\
\;\;\;\;x - a \cdot \left(x \cdot \left(z + b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.1600000000000001e-42

    1. Initial program 98.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 57.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg57.6%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out57.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative57.6%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified57.6%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 26.5%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg26.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg26.5%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified26.5%

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

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

    if -1.1600000000000001e-42 < y < 1.15e-5

    1. Initial program 93.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 83.1%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg83.1%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define90.8%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified90.8%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 90.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b} + -1 \cdot \left(a \cdot z\right)} \]
      2. associate-*r*90.8%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot b + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      3. distribute-lft-out90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(b + z\right)}} \]
      4. mul-1-neg90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
    8. Simplified90.8%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
    9. Taylor expanded in a around 0 47.2%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg47.2%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
      2. unsub-neg47.2%

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot \left(b + z\right)\right)} \]
      3. *-commutative47.2%

        \[\leadsto x - a \cdot \color{blue}{\left(\left(b + z\right) \cdot x\right)} \]
    11. Simplified47.2%

      \[\leadsto \color{blue}{x - a \cdot \left(\left(b + z\right) \cdot x\right)} \]

    if 1.15e-5 < y

    1. Initial program 96.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 59.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg59.8%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out59.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative59.8%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified59.8%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 22.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg22.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg22.0%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified22.0%

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

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

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

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

        \[\leadsto \color{blue}{-x \cdot \left(y \cdot t\right)} \]
      4. distribute-rgt-neg-in31.2%

        \[\leadsto \color{blue}{x \cdot \left(-y \cdot t\right)} \]
      5. *-commutative31.2%

        \[\leadsto x \cdot \left(-\color{blue}{t \cdot y}\right) \]
      6. distribute-rgt-neg-in31.2%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \left(-y\right)\right)} \]
    11. Simplified31.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.16 \cdot 10^{-42}:\\ \;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-5}:\\ \;\;\;\;x - a \cdot \left(x \cdot \left(z + b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 33.8% accurate, 16.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-42}:\\
\;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\

\mathbf{elif}\;y \leq 0.28:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.80000000000000005e-42

    1. Initial program 98.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 57.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg57.6%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out57.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative57.6%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified57.6%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 26.5%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg26.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg26.5%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified26.5%

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

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

    if -4.80000000000000005e-42 < y < 0.28000000000000003

    1. Initial program 93.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 83.1%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg83.1%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define90.8%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified90.8%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 90.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b} + -1 \cdot \left(a \cdot z\right)} \]
      2. associate-*r*90.8%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot b + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      3. distribute-lft-out90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(b + z\right)}} \]
      4. mul-1-neg90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
    8. Simplified90.8%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
    9. Taylor expanded in a around 0 47.5%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. neg-mul-147.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot \left(b + z\right)\right)}\right) \]
      2. distribute-rgt-neg-in47.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{a \cdot \left(-\left(b + z\right)\right)}\right) \]
    11. Simplified47.5%

      \[\leadsto x \cdot \color{blue}{\left(1 + a \cdot \left(-\left(b + z\right)\right)\right)} \]

    if 0.28000000000000003 < y

    1. Initial program 96.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 59.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg59.8%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out59.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative59.8%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified59.8%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 22.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg22.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg22.0%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified22.0%

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

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

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

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

        \[\leadsto \color{blue}{-x \cdot \left(y \cdot t\right)} \]
      4. distribute-rgt-neg-in31.2%

        \[\leadsto \color{blue}{x \cdot \left(-y \cdot t\right)} \]
      5. *-commutative31.2%

        \[\leadsto x \cdot \left(-\color{blue}{t \cdot y}\right) \]
      6. distribute-rgt-neg-in31.2%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \left(-y\right)\right)} \]
    11. Simplified31.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{-42}:\\ \;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\ \mathbf{elif}\;y \leq 0.28:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 32.7% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+22}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.1e22

    1. Initial program 98.1%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 61.2%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg61.2%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out61.2%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative61.2%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified61.2%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 27.4%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg27.4%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg27.4%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified27.4%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg30.3%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. distribute-rgt-neg-out30.3%

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in30.3%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified30.3%

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

    if -1.1e22 < y < 1.24999999999999994e-7

    1. Initial program 94.2%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 79.4%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg79.4%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define86.8%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified86.8%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 86.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*86.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b} + -1 \cdot \left(a \cdot z\right)} \]
      2. associate-*r*86.8%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot b + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      3. distribute-lft-out86.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(b + z\right)}} \]
      4. mul-1-neg86.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
    8. Simplified86.8%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
    9. Taylor expanded in a around 0 43.8%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. neg-mul-143.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot \left(b + z\right)\right)}\right) \]
      2. distribute-rgt-neg-in43.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{a \cdot \left(-\left(b + z\right)\right)}\right) \]
    11. Simplified43.8%

      \[\leadsto x \cdot \color{blue}{\left(1 + a \cdot \left(-\left(b + z\right)\right)\right)} \]
    12. Taylor expanded in z around 0 42.7%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(a \cdot b\right)\right)} \]
    13. Step-by-step derivation
      1. mul-1-neg42.7%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot b\right)}\right) \]
      2. unsub-neg42.7%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    14. Simplified42.7%

      \[\leadsto \color{blue}{x \cdot \left(1 - a \cdot b\right)} \]

    if 1.24999999999999994e-7 < y

    1. Initial program 96.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 59.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg59.8%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out59.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative59.8%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified59.8%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 22.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg22.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg22.0%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified22.0%

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

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

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

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

        \[\leadsto \color{blue}{-x \cdot \left(y \cdot t\right)} \]
      4. distribute-rgt-neg-in31.2%

        \[\leadsto \color{blue}{x \cdot \left(-y \cdot t\right)} \]
      5. *-commutative31.2%

        \[\leadsto x \cdot \left(-\color{blue}{t \cdot y}\right) \]
      6. distribute-rgt-neg-in31.2%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \left(-y\right)\right)} \]
    11. Simplified31.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{+22}:\\ \;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-7}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 33.4% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-42}:\\
\;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\

\mathbf{elif}\;y \leq 0.044:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.80000000000000005e-42

    1. Initial program 98.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 57.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg57.6%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out57.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative57.6%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified57.6%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 26.5%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg26.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg26.5%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified26.5%

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

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

    if -4.80000000000000005e-42 < y < 0.043999999999999997

    1. Initial program 93.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 83.1%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg83.1%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define90.8%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified90.8%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 90.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot b} + -1 \cdot \left(a \cdot z\right)} \]
      2. associate-*r*90.8%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot b + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      3. distribute-lft-out90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(b + z\right)}} \]
      4. mul-1-neg90.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(b + z\right)} \]
    8. Simplified90.8%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
    9. Taylor expanded in a around 0 47.5%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. neg-mul-147.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot \left(b + z\right)\right)}\right) \]
      2. distribute-rgt-neg-in47.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{a \cdot \left(-\left(b + z\right)\right)}\right) \]
    11. Simplified47.5%

      \[\leadsto x \cdot \color{blue}{\left(1 + a \cdot \left(-\left(b + z\right)\right)\right)} \]
    12. Taylor expanded in z around 0 46.2%

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(a \cdot b\right)\right)} \]
    13. Step-by-step derivation
      1. mul-1-neg46.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot b\right)}\right) \]
      2. unsub-neg46.2%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    14. Simplified46.2%

      \[\leadsto \color{blue}{x \cdot \left(1 - a \cdot b\right)} \]

    if 0.043999999999999997 < y

    1. Initial program 96.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 59.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg59.8%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out59.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative59.8%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified59.8%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 22.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg22.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg22.0%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified22.0%

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

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

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

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

        \[\leadsto \color{blue}{-x \cdot \left(y \cdot t\right)} \]
      4. distribute-rgt-neg-in31.2%

        \[\leadsto \color{blue}{x \cdot \left(-y \cdot t\right)} \]
      5. *-commutative31.2%

        \[\leadsto x \cdot \left(-\color{blue}{t \cdot y}\right) \]
      6. distribute-rgt-neg-in31.2%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \left(-y\right)\right)} \]
    11. Simplified31.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{-42}:\\ \;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\ \mathbf{elif}\;y \leq 0.044:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 27.0% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{-42} \lor \neg \left(y \leq 5.5 \cdot 10^{-5}\right):\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.39999999999999998e-42 or 5.5000000000000002e-5 < y

    1. Initial program 97.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 58.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg58.8%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out58.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative58.8%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified58.8%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 24.1%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg24.1%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg24.1%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified24.1%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg27.2%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. distribute-rgt-neg-out27.2%

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in27.2%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified27.2%

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

    if -5.39999999999999998e-42 < y < 5.5000000000000002e-5

    1. Initial program 93.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 53.7%

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

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

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

Alternative 17: 27.9% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{-42}:\\
\;\;\;\;t \cdot \left(y \cdot \left(-x\right)\right)\\

\mathbf{elif}\;y \leq 0.00032:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.39999999999999998e-42

    1. Initial program 98.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 57.6%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg57.6%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out57.6%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative57.6%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified57.6%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 26.5%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg26.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg26.5%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified26.5%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg27.8%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. distribute-rgt-neg-out27.8%

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in27.8%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified27.8%

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

    if -5.39999999999999998e-42 < y < 3.20000000000000026e-4

    1. Initial program 93.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 53.7%

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

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

    if 3.20000000000000026e-4 < y

    1. Initial program 96.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 59.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg59.8%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out59.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative59.8%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified59.8%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 22.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg22.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg22.0%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified22.0%

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

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

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

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

        \[\leadsto \color{blue}{-x \cdot \left(y \cdot t\right)} \]
      4. distribute-rgt-neg-in31.2%

        \[\leadsto \color{blue}{x \cdot \left(-y \cdot t\right)} \]
      5. *-commutative31.2%

        \[\leadsto x \cdot \left(-\color{blue}{t \cdot y}\right) \]
      6. distribute-rgt-neg-in31.2%

        \[\leadsto x \cdot \color{blue}{\left(t \cdot \left(-y\right)\right)} \]
    11. Simplified31.2%

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

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

Alternative 18: 21.3% accurate, 20.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{+133} \lor \neg \left(b \leq 4.6 \cdot 10^{+184}\right):\\
\;\;\;\;t \cdot \left(x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.00000000000000007e133 or 4.6e184 < b

    1. Initial program 96.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 36.9%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg36.9%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out36.9%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative36.9%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified36.9%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 13.4%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg13.4%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg13.4%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified13.4%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg26.9%

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

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in26.9%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified26.9%

      \[\leadsto \color{blue}{t \cdot \left(x \cdot \left(-y\right)\right)} \]
    12. Step-by-step derivation
      1. pow126.9%

        \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot \left(-y\right)\right)\right)}^{1}} \]
      2. add-sqr-sqrt16.3%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}\right)\right)}^{1} \]
      3. sqrt-unprod33.1%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)\right)}^{1} \]
      4. sqr-neg33.1%

        \[\leadsto {\left(t \cdot \left(x \cdot \sqrt{\color{blue}{y \cdot y}}\right)\right)}^{1} \]
      5. sqrt-unprod8.6%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}\right)\right)}^{1} \]
      6. add-sqr-sqrt23.0%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{y}\right)\right)}^{1} \]
    13. Applied egg-rr23.0%

      \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot y\right)\right)}^{1}} \]
    14. Step-by-step derivation
      1. unpow123.0%

        \[\leadsto \color{blue}{t \cdot \left(x \cdot y\right)} \]
    15. Simplified23.0%

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

    if -3.00000000000000007e133 < b < 4.6e184

    1. Initial program 95.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 78.5%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification22.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3 \cdot 10^{+133} \lor \neg \left(b \leq 4.6 \cdot 10^{+184}\right):\\ \;\;\;\;t \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 21.3% accurate, 21.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.8 \cdot 10^{+127}:\\
\;\;\;\;t \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;b \leq 1.35 \cdot 10^{+181}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -6.79999999999999955e127

    1. Initial program 97.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 41.5%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg41.5%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out41.5%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative41.5%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified41.5%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 12.4%

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg12.4%

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg12.4%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified12.4%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg26.7%

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

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in26.7%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified26.7%

      \[\leadsto \color{blue}{t \cdot \left(x \cdot \left(-y\right)\right)} \]
    12. Step-by-step derivation
      1. pow126.7%

        \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot \left(-y\right)\right)\right)}^{1}} \]
      2. add-sqr-sqrt19.3%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}\right)\right)}^{1} \]
      3. sqrt-unprod34.9%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)\right)}^{1} \]
      4. sqr-neg34.9%

        \[\leadsto {\left(t \cdot \left(x \cdot \sqrt{\color{blue}{y \cdot y}}\right)\right)}^{1} \]
      5. sqrt-unprod4.0%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}\right)\right)}^{1} \]
      6. add-sqr-sqrt23.0%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{y}\right)\right)}^{1} \]
    13. Applied egg-rr23.0%

      \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot y\right)\right)}^{1}} \]
    14. Step-by-step derivation
      1. unpow123.0%

        \[\leadsto \color{blue}{t \cdot \left(x \cdot y\right)} \]
    15. Simplified23.0%

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

    if -6.79999999999999955e127 < b < 1.35000000000000004e181

    1. Initial program 95.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 78.5%

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

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

    if 1.35000000000000004e181 < b

    1. Initial program 96.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 30.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg30.8%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. distribute-lft-neg-out30.8%

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative30.8%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    5. Simplified30.8%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0 14.6%

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

        \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
      2. unsub-neg14.6%

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
    8. Simplified14.6%

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg27.1%

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. distribute-rgt-neg-out27.1%

        \[\leadsto \color{blue}{t \cdot \left(-x \cdot y\right)} \]
      3. distribute-rgt-neg-in27.1%

        \[\leadsto t \cdot \color{blue}{\left(x \cdot \left(-y\right)\right)} \]
    11. Simplified27.1%

      \[\leadsto \color{blue}{t \cdot \left(x \cdot \left(-y\right)\right)} \]
    12. Step-by-step derivation
      1. pow127.1%

        \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot \left(-y\right)\right)\right)}^{1}} \]
      2. add-sqr-sqrt12.4%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}\right)\right)}^{1} \]
      3. sqrt-unprod30.7%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)\right)}^{1} \]
      4. sqr-neg30.7%

        \[\leadsto {\left(t \cdot \left(x \cdot \sqrt{\color{blue}{y \cdot y}}\right)\right)}^{1} \]
      5. sqrt-unprod14.7%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}\right)\right)}^{1} \]
      6. add-sqr-sqrt23.0%

        \[\leadsto {\left(t \cdot \left(x \cdot \color{blue}{y}\right)\right)}^{1} \]
    13. Applied egg-rr23.0%

      \[\leadsto \color{blue}{{\left(t \cdot \left(x \cdot y\right)\right)}^{1}} \]
    14. Step-by-step derivation
      1. unpow123.0%

        \[\leadsto \color{blue}{t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*26.9%

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

        \[\leadsto \color{blue}{\left(x \cdot t\right)} \cdot y \]
      4. associate-*r*23.1%

        \[\leadsto \color{blue}{x \cdot \left(t \cdot y\right)} \]
    15. Simplified23.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.8 \cdot 10^{+127}:\\ \;\;\;\;t \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{+181}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 24.1% accurate, 63.0× speedup?

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

\\
y \cdot \frac{x}{y}
\end{array}
Derivation
  1. Initial program 95.7%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in t around inf 56.7%

    \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
  4. Step-by-step derivation
    1. mul-1-neg56.7%

      \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
    2. distribute-lft-neg-out56.7%

      \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
    3. *-commutative56.7%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
  5. Simplified56.7%

    \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
  6. Taylor expanded in y around 0 29.8%

    \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot \left(x \cdot y\right)\right)} \]
  7. Step-by-step derivation
    1. mul-1-neg29.8%

      \[\leadsto x + \color{blue}{\left(-t \cdot \left(x \cdot y\right)\right)} \]
    2. unsub-neg29.8%

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

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

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

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

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

    \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]
  13. Final simplification22.2%

    \[\leadsto y \cdot \frac{x}{y} \]
  14. Add Preprocessing

Alternative 21: 19.6% accurate, 315.0× speedup?

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

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

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf 73.1%

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification18.2%

    \[\leadsto x \]
  6. Add Preprocessing

Reproduce

?
herbie shell --seed 2024055 
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
  :precision binary64
  (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))