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

Percentage Accurate: 96.4% → 99.6%
Time: 23.4s
Alternatives: 16
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 16 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.4% 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 96.6%

    \[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-def97.0%

      \[\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-neg97.0%

      \[\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-def99.6%

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

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

    \[\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.4% 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}
Derivation
  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. Final simplification96.6%

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

Alternative 3: 76.2% accurate, 1.4× speedup?

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

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

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

\mathbf{elif}\;y \leq 1.8 \cdot 10^{+225}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.85 \cdot 10^{+265}:\\
\;\;\;\;x \cdot {\left(e^{y}\right)}^{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.6e19 or 1.15000000000000001e-38 < y < 1.7999999999999999e225

    1. Initial program 100.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 59.9%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{{\left({\left(e^{y}\right)}^{-1}\right)}^{t}} \]
    7. Applied egg-rr75.6%

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

        \[\leadsto x \cdot {\color{blue}{\left(\frac{1}{e^{y}}\right)}}^{t} \]
      2. rec-exp75.6%

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

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

    if -1.6e19 < y < 1.15000000000000001e-38

    1. Initial program 94.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 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. neg-mul-179.4%

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

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-1 \cdot z\right)} - b\right)} \]
      4. neg-mul-184.0%

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 84.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*84.0%

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

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

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

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

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

    if 1.7999999999999999e225 < y < 1.85e265

    1. Initial program 85.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 16.6%

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{y \cdot \left(-t\right)}\right)\right)} \]
      2. expm1-udef16.6%

        \[\leadsto x \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(e^{y \cdot \left(-t\right)}\right)} - 1\right)} \]
      3. exp-prod15.6%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{{\left(e^{y}\right)}^{\left(-t\right)}}\right)} - 1\right) \]
      4. add-sqr-sqrt15.4%

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

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

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{y}\right)}^{\left(\sqrt{\color{blue}{t \cdot t}}\right)}\right)} - 1\right) \]
      7. sqrt-unprod14.3%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{y}\right)}^{\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}}\right)} - 1\right) \]
      8. add-sqr-sqrt85.9%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{y}\right)}^{\color{blue}{t}}\right)} - 1\right) \]
    7. Applied egg-rr85.9%

      \[\leadsto x \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({\left(e^{y}\right)}^{t}\right)} - 1\right)} \]
    8. Step-by-step derivation
      1. expm1-def85.9%

        \[\leadsto x \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(e^{y}\right)}^{t}\right)\right)} \]
      2. expm1-log1p85.9%

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

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

    if 1.85e265 < y

    1. Initial program 83.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 t around inf 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+19}:\\ \;\;\;\;x \cdot {\left(e^{-y}\right)}^{t}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-38}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{+225}:\\ \;\;\;\;x \cdot {\left(e^{-y}\right)}^{t}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+265}:\\ \;\;\;\;x \cdot {\left(e^{y}\right)}^{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 87.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.6 \cdot 10^{-57} \lor \neg \left(y \leq 9.6 \cdot 10^{-39}\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 -3.6e-57) (not (<= y 9.6e-39)))
   (* 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 <= -3.6e-57) || !(y <= 9.6e-39)) {
		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 <= (-3.6d-57)) .or. (.not. (y <= 9.6d-39))) 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 <= -3.6e-57) || !(y <= 9.6e-39)) {
		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 <= -3.6e-57) or not (y <= 9.6e-39):
		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 <= -3.6e-57) || !(y <= 9.6e-39))
		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 <= -3.6e-57) || ~((y <= 9.6e-39)))
		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, -3.6e-57], N[Not[LessEqual[y, 9.6e-39]], $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 -3.6 \cdot 10^{-57} \lor \neg \left(y \leq 9.6 \cdot 10^{-39}\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 < -3.6000000000000002e-57 or 9.60000000000000063e-39 < y

    1. Initial program 98.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 90.3%

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

    if -3.6000000000000002e-57 < y < 9.60000000000000063e-39

    1. Initial program 93.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 81.3%

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

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

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

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-1 \cdot z\right)} - b\right)} \]
      4. neg-mul-187.7%

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

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

      \[\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*87.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.6 \cdot 10^{-57} \lor \neg \left(y \leq 9.6 \cdot 10^{-39}\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 5: 74.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{if}\;t \leq -200:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-183}:\\ \;\;\;\;x \cdot {\left(e^{y}\right)}^{t}\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{+28}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (exp (* t (- y))))))
   (if (<= t -200.0)
     t_1
     (if (<= t -1.35e-183)
       (* x (pow (exp y) t))
       (if (<= t 1.75e+28) (* x (exp (* (- a) (+ z b)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * exp((t * -y));
	double tmp;
	if (t <= -200.0) {
		tmp = t_1;
	} else if (t <= -1.35e-183) {
		tmp = x * pow(exp(y), t);
	} else if (t <= 1.75e+28) {
		tmp = x * exp((-a * (z + b)));
	} 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((t * -y))
    if (t <= (-200.0d0)) then
        tmp = t_1
    else if (t <= (-1.35d-183)) then
        tmp = x * (exp(y) ** t)
    else if (t <= 1.75d+28) then
        tmp = x * exp((-a * (z + b)))
    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((t * -y));
	double tmp;
	if (t <= -200.0) {
		tmp = t_1;
	} else if (t <= -1.35e-183) {
		tmp = x * Math.pow(Math.exp(y), t);
	} else if (t <= 1.75e+28) {
		tmp = x * Math.exp((-a * (z + b)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.exp((t * -y))
	tmp = 0
	if t <= -200.0:
		tmp = t_1
	elif t <= -1.35e-183:
		tmp = x * math.pow(math.exp(y), t)
	elif t <= 1.75e+28:
		tmp = x * math.exp((-a * (z + b)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * exp(Float64(t * Float64(-y))))
	tmp = 0.0
	if (t <= -200.0)
		tmp = t_1;
	elseif (t <= -1.35e-183)
		tmp = Float64(x * (exp(y) ^ t));
	elseif (t <= 1.75e+28)
		tmp = Float64(x * exp(Float64(Float64(-a) * Float64(z + b))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * exp((t * -y));
	tmp = 0.0;
	if (t <= -200.0)
		tmp = t_1;
	elseif (t <= -1.35e-183)
		tmp = x * (exp(y) ^ t);
	elseif (t <= 1.75e+28)
		tmp = x * exp((-a * (z + b)));
	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[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -200.0], t$95$1, If[LessEqual[t, -1.35e-183], N[(x * N[Power[N[Exp[y], $MachinePrecision], t], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+28], N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.35 \cdot 10^{-183}:\\
\;\;\;\;x \cdot {\left(e^{y}\right)}^{t}\\

\mathbf{elif}\;t \leq 1.75 \cdot 10^{+28}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -200 or 1.75e28 < t

    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 77.9%

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

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

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

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

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

    if -200 < t < -1.35000000000000004e-183

    1. Initial program 97.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 t around inf 24.0%

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u24.0%

        \[\leadsto x \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{y \cdot \left(-t\right)}\right)\right)} \]
      2. expm1-udef24.0%

        \[\leadsto x \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(e^{y \cdot \left(-t\right)}\right)} - 1\right)} \]
      3. exp-prod23.8%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{{\left(e^{y}\right)}^{\left(-t\right)}}\right)} - 1\right) \]
      4. add-sqr-sqrt23.8%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{y}\right)}^{\color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)}}\right)} - 1\right) \]
      5. sqrt-unprod23.9%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{y}\right)}^{\color{blue}{\left(\sqrt{\left(-t\right) \cdot \left(-t\right)}\right)}}\right)} - 1\right) \]
      6. sqr-neg23.9%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{y}\right)}^{\left(\sqrt{\color{blue}{t \cdot t}}\right)}\right)} - 1\right) \]
      7. sqrt-unprod20.3%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{y}\right)}^{\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}}\right)} - 1\right) \]
      8. add-sqr-sqrt74.4%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{y}\right)}^{\color{blue}{t}}\right)} - 1\right) \]
    7. Applied egg-rr74.4%

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

        \[\leadsto x \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(e^{y}\right)}^{t}\right)\right)} \]
      2. expm1-log1p74.4%

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

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

    if -1.35000000000000004e-183 < t < 1.75e28

    1. Initial program 96.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 0 64.9%

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

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

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

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-1 \cdot z\right)} - b\right)} \]
      4. neg-mul-169.3%

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

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

      \[\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*69.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -200:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-183}:\\ \;\;\;\;x \cdot {\left(e^{y}\right)}^{t}\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{+28}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 58.0% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{if}\;b \leq -3 \cdot 10^{-218}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 4.3 \cdot 10^{-302}:\\ \;\;\;\;\frac{1}{\frac{1}{a \cdot \left(x \cdot b\right)}}\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{-121}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (exp (* a (- b))))))
   (if (<= b -3e-218)
     t_1
     (if (<= b 4.3e-302)
       (/ 1.0 (/ 1.0 (* a (* x b))))
       (if (<= b 4.2e-121) (* x (- 1.0 (* y t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * exp((a * -b));
	double tmp;
	if (b <= -3e-218) {
		tmp = t_1;
	} else if (b <= 4.3e-302) {
		tmp = 1.0 / (1.0 / (a * (x * b)));
	} else if (b <= 4.2e-121) {
		tmp = x * (1.0 - (y * t));
	} 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((a * -b))
    if (b <= (-3d-218)) then
        tmp = t_1
    else if (b <= 4.3d-302) then
        tmp = 1.0d0 / (1.0d0 / (a * (x * b)))
    else if (b <= 4.2d-121) then
        tmp = x * (1.0d0 - (y * t))
    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((a * -b));
	double tmp;
	if (b <= -3e-218) {
		tmp = t_1;
	} else if (b <= 4.3e-302) {
		tmp = 1.0 / (1.0 / (a * (x * b)));
	} else if (b <= 4.2e-121) {
		tmp = x * (1.0 - (y * t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.exp((a * -b))
	tmp = 0
	if b <= -3e-218:
		tmp = t_1
	elif b <= 4.3e-302:
		tmp = 1.0 / (1.0 / (a * (x * b)))
	elif b <= 4.2e-121:
		tmp = x * (1.0 - (y * t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * exp(Float64(a * Float64(-b))))
	tmp = 0.0
	if (b <= -3e-218)
		tmp = t_1;
	elseif (b <= 4.3e-302)
		tmp = Float64(1.0 / Float64(1.0 / Float64(a * Float64(x * b))));
	elseif (b <= 4.2e-121)
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * exp((a * -b));
	tmp = 0.0;
	if (b <= -3e-218)
		tmp = t_1;
	elseif (b <= 4.3e-302)
		tmp = 1.0 / (1.0 / (a * (x * b)));
	elseif (b <= 4.2e-121)
		tmp = x * (1.0 - (y * t));
	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[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3e-218], t$95$1, If[LessEqual[b, 4.3e-302], N[(1.0 / N[(1.0 / N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.2e-121], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{if}\;b \leq -3 \cdot 10^{-218}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 4.3 \cdot 10^{-302}:\\
\;\;\;\;\frac{1}{\frac{1}{a \cdot \left(x \cdot b\right)}}\\

\mathbf{elif}\;b \leq 4.2 \cdot 10^{-121}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -2.9999999999999998e-218 or 4.1999999999999997e-121 < b

    1. Initial program 98.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 62.1%

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

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

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

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

    if -2.9999999999999998e-218 < b < 4.3000000000000002e-302

    1. Initial program 78.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 b around inf 17.3%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    8. Simplified17.4%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-out--17.4%

        \[\leadsto \color{blue}{1 \cdot x - \left(a \cdot b\right) \cdot x} \]
      2. *-un-lft-identity17.4%

        \[\leadsto \color{blue}{x} - \left(a \cdot b\right) \cdot x \]
      3. associate-*r*17.4%

        \[\leadsto x - \color{blue}{a \cdot \left(b \cdot x\right)} \]
      4. flip--42.7%

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}{x + a \cdot \left(b \cdot x\right)}} \]
      5. clear-num42.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{x + a \cdot \left(b \cdot x\right)}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}}} \]
      6. *-un-lft-identity42.7%

        \[\leadsto \frac{1}{\frac{\color{blue}{1 \cdot x} + a \cdot \left(b \cdot x\right)}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}} \]
      7. associate-*r*42.7%

        \[\leadsto \frac{1}{\frac{1 \cdot x + \color{blue}{\left(a \cdot b\right) \cdot x}}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}} \]
      8. distribute-rgt-out42.7%

        \[\leadsto \frac{1}{\frac{\color{blue}{x \cdot \left(1 + a \cdot b\right)}}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}} \]
      9. difference-of-squares42.7%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\color{blue}{\left(x + a \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}}} \]
      10. add-sqr-sqrt28.2%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      11. sqrt-unprod33.1%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \color{blue}{\sqrt{a \cdot a}} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      12. sqr-neg33.1%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \sqrt{\color{blue}{\left(-a\right) \cdot \left(-a\right)}} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      13. sqrt-unprod14.5%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \color{blue}{\left(\sqrt{-a} \cdot \sqrt{-a}\right)} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      14. add-sqr-sqrt42.7%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \color{blue}{\left(-a\right)} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      15. cancel-sign-sub-inv42.7%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\color{blue}{\left(x - a \cdot \left(b \cdot x\right)\right)} \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      16. pow242.7%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\color{blue}{{\left(x - a \cdot \left(b \cdot x\right)\right)}^{2}}}} \]
    10. Applied egg-rr42.6%

      \[\leadsto \color{blue}{\frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{{\left(x \cdot \left(1 + a \cdot b\right)\right)}^{2}}}} \]
    11. Taylor expanded in a around inf 47.4%

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

    if 4.3000000000000002e-302 < b < 4.1999999999999997e-121

    1. Initial program 100.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 74.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 75.6% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.65 \cdot 10^{+62} \lor \neg \left(t \leq 1.62 \cdot 10^{+28}\right):\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\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 (<= t -3.65e+62) (not (<= t 1.62e+28)))
   (* x (exp (* t (- y))))
   (* x (exp (* (- a) (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((t <= -3.65e+62) || !(t <= 1.62e+28)) {
		tmp = x * exp((t * -y));
	} 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 ((t <= (-3.65d+62)) .or. (.not. (t <= 1.62d+28))) then
        tmp = x * exp((t * -y))
    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 ((t <= -3.65e+62) || !(t <= 1.62e+28)) {
		tmp = x * Math.exp((t * -y));
	} else {
		tmp = x * Math.exp((-a * (z + b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (t <= -3.65e+62) or not (t <= 1.62e+28):
		tmp = x * math.exp((t * -y))
	else:
		tmp = x * math.exp((-a * (z + b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((t <= -3.65e+62) || !(t <= 1.62e+28))
		tmp = Float64(x * exp(Float64(t * Float64(-y))));
	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 ((t <= -3.65e+62) || ~((t <= 1.62e+28)))
		tmp = x * exp((t * -y));
	else
		tmp = x * exp((-a * (z + b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.65e+62], N[Not[LessEqual[t, 1.62e+28]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.65 \cdot 10^{+62} \lor \neg \left(t \leq 1.62 \cdot 10^{+28}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\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 t < -3.6499999999999998e62 or 1.62000000000000006e28 < t

    1. Initial program 96.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 80.1%

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

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

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

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

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

    if -3.6499999999999998e62 < t < 1.62000000000000006e28

    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 59.3%

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

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

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

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-1 \cdot z\right)} - b\right)} \]
      4. neg-mul-164.8%

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 64.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*64.8%

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

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

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

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

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

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

Alternative 8: 72.8% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{+27} \lor \neg \left(t \leq 1.7 \cdot 10^{+28}\right):\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \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 (<= t -4e+27) (not (<= t 1.7e+28)))
   (* x (exp (* t (- y))))
   (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((t <= -4e+27) || !(t <= 1.7e+28)) {
		tmp = x * exp((t * -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 ((t <= (-4d+27)) .or. (.not. (t <= 1.7d+28))) then
        tmp = x * exp((t * -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 ((t <= -4e+27) || !(t <= 1.7e+28)) {
		tmp = x * Math.exp((t * -y));
	} else {
		tmp = x * Math.exp((a * -b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (t <= -4e+27) or not (t <= 1.7e+28):
		tmp = x * math.exp((t * -y))
	else:
		tmp = x * math.exp((a * -b))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((t <= -4e+27) || !(t <= 1.7e+28))
		tmp = Float64(x * exp(Float64(t * Float64(-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 ((t <= -4e+27) || ~((t <= 1.7e+28)))
		tmp = x * exp((t * -y));
	else
		tmp = x * exp((a * -b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4e+27], N[Not[LessEqual[t, 1.7e+28]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+27} \lor \neg \left(t \leq 1.7 \cdot 10^{+28}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.0000000000000001e27 or 1.7e28 < t

    1. Initial program 96.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 78.9%

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

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

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

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

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

    if -4.0000000000000001e27 < t < 1.7e28

    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 b around inf 60.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{+27} \lor \neg \left(t \leq 1.7 \cdot 10^{+28}\right):\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 33.2% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 - a \cdot b\\ \mathbf{if}\;t \leq -4.1 \cdot 10^{+27}:\\ \;\;\;\;x \cdot e^{a \cdot b}\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-258}:\\ \;\;\;\;x \cdot e^{y \cdot t}\\ \mathbf{elif}\;t \leq 2.45 \cdot 10^{-288}:\\ \;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-121}:\\ \;\;\;\;\frac{1}{\frac{t_1}{x}}\\ \mathbf{elif}\;t \leq 3800000:\\ \;\;\;\;x \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- 1.0 (* a b))))
   (if (<= t -4.1e+27)
     (* x (exp (* a b)))
     (if (<= t -3.1e-258)
       (* x (exp (* y t)))
       (if (<= t 2.45e-288)
         (* (- b) (* x a))
         (if (<= t 4.2e-121)
           (/ 1.0 (/ t_1 x))
           (if (<= t 3800000.0) (* x t_1) (* x (- 1.0 (* y t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = 1.0 - (a * b);
	double tmp;
	if (t <= -4.1e+27) {
		tmp = x * exp((a * b));
	} else if (t <= -3.1e-258) {
		tmp = x * exp((y * t));
	} else if (t <= 2.45e-288) {
		tmp = -b * (x * a);
	} else if (t <= 4.2e-121) {
		tmp = 1.0 / (t_1 / x);
	} else if (t <= 3800000.0) {
		tmp = x * t_1;
	} else {
		tmp = x * (1.0 - (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) :: t_1
    real(8) :: tmp
    t_1 = 1.0d0 - (a * b)
    if (t <= (-4.1d+27)) then
        tmp = x * exp((a * b))
    else if (t <= (-3.1d-258)) then
        tmp = x * exp((y * t))
    else if (t <= 2.45d-288) then
        tmp = -b * (x * a)
    else if (t <= 4.2d-121) then
        tmp = 1.0d0 / (t_1 / x)
    else if (t <= 3800000.0d0) then
        tmp = x * t_1
    else
        tmp = x * (1.0d0 - (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 t_1 = 1.0 - (a * b);
	double tmp;
	if (t <= -4.1e+27) {
		tmp = x * Math.exp((a * b));
	} else if (t <= -3.1e-258) {
		tmp = x * Math.exp((y * t));
	} else if (t <= 2.45e-288) {
		tmp = -b * (x * a);
	} else if (t <= 4.2e-121) {
		tmp = 1.0 / (t_1 / x);
	} else if (t <= 3800000.0) {
		tmp = x * t_1;
	} else {
		tmp = x * (1.0 - (y * t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = 1.0 - (a * b)
	tmp = 0
	if t <= -4.1e+27:
		tmp = x * math.exp((a * b))
	elif t <= -3.1e-258:
		tmp = x * math.exp((y * t))
	elif t <= 2.45e-288:
		tmp = -b * (x * a)
	elif t <= 4.2e-121:
		tmp = 1.0 / (t_1 / x)
	elif t <= 3800000.0:
		tmp = x * t_1
	else:
		tmp = x * (1.0 - (y * t))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(1.0 - Float64(a * b))
	tmp = 0.0
	if (t <= -4.1e+27)
		tmp = Float64(x * exp(Float64(a * b)));
	elseif (t <= -3.1e-258)
		tmp = Float64(x * exp(Float64(y * t)));
	elseif (t <= 2.45e-288)
		tmp = Float64(Float64(-b) * Float64(x * a));
	elseif (t <= 4.2e-121)
		tmp = Float64(1.0 / Float64(t_1 / x));
	elseif (t <= 3800000.0)
		tmp = Float64(x * t_1);
	else
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = 1.0 - (a * b);
	tmp = 0.0;
	if (t <= -4.1e+27)
		tmp = x * exp((a * b));
	elseif (t <= -3.1e-258)
		tmp = x * exp((y * t));
	elseif (t <= 2.45e-288)
		tmp = -b * (x * a);
	elseif (t <= 4.2e-121)
		tmp = 1.0 / (t_1 / x);
	elseif (t <= 3800000.0)
		tmp = x * t_1;
	else
		tmp = x * (1.0 - (y * t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.1e+27], N[(x * N[Exp[N[(a * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.1e-258], N[(x * N[Exp[N[(y * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.45e-288], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-121], N[(1.0 / N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3800000.0], N[(x * t$95$1), $MachinePrecision], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 1 - a \cdot b\\
\mathbf{if}\;t \leq -4.1 \cdot 10^{+27}:\\
\;\;\;\;x \cdot e^{a \cdot b}\\

\mathbf{elif}\;t \leq -3.1 \cdot 10^{-258}:\\
\;\;\;\;x \cdot e^{y \cdot t}\\

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

\mathbf{elif}\;t \leq 4.2 \cdot 10^{-121}:\\
\;\;\;\;\frac{1}{\frac{t_1}{x}}\\

\mathbf{elif}\;t \leq 3800000:\\
\;\;\;\;x \cdot t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if t < -4.1000000000000002e27

    1. Initial program 95.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 b around inf 40.3%

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u40.3%

        \[\leadsto x \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{a \cdot \left(-b\right)}\right)\right)} \]
      2. expm1-udef40.3%

        \[\leadsto x \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(e^{a \cdot \left(-b\right)}\right)} - 1\right)} \]
      3. *-commutative40.3%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left(e^{\color{blue}{\left(-b\right) \cdot a}}\right)} - 1\right) \]
      4. exp-prod38.7%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{{\left(e^{-b}\right)}^{a}}\right)} - 1\right) \]
      5. add-sqr-sqrt14.5%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}\right)}^{a}\right)} - 1\right) \]
      6. sqrt-unprod24.0%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}\right)}^{a}\right)} - 1\right) \]
      7. sqr-neg24.0%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{\sqrt{\color{blue}{b \cdot b}}}\right)}^{a}\right)} - 1\right) \]
      8. sqrt-unprod9.4%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}\right)}^{a}\right)} - 1\right) \]
      9. add-sqr-sqrt15.8%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{\color{blue}{b}}\right)}^{a}\right)} - 1\right) \]
    7. Applied egg-rr15.8%

      \[\leadsto x \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({\left(e^{b}\right)}^{a}\right)} - 1\right)} \]
    8. Step-by-step derivation
      1. expm1-def15.8%

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

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

        \[\leadsto x \cdot \color{blue}{e^{b \cdot a}} \]
      4. *-commutative20.6%

        \[\leadsto x \cdot e^{\color{blue}{a \cdot b}} \]
      5. exp-prod20.6%

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

      \[\leadsto x \cdot \color{blue}{{\left(e^{a}\right)}^{b}} \]
    10. Taylor expanded in a around inf 20.6%

      \[\leadsto x \cdot \color{blue}{e^{a \cdot b}} \]

    if -4.1000000000000002e27 < t < -3.09999999999999999e-258

    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 28.1%

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{{\left({\left(e^{y}\right)}^{-1}\right)}^{t}} \]
    7. Applied egg-rr29.6%

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

        \[\leadsto x \cdot {\color{blue}{\left(\frac{1}{e^{y}}\right)}}^{t} \]
      2. rec-exp29.6%

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

      \[\leadsto x \cdot \color{blue}{{\left(e^{-y}\right)}^{t}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt11.6%

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{e^{y \cdot t}} \]
    11. Applied egg-rr51.9%

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

    if -3.09999999999999999e-258 < t < 2.45000000000000013e-288

    1. Initial program 100.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 38.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(b \cdot x\right) \cdot a} \]
      3. associate-*r*46.9%

        \[\leadsto -\color{blue}{b \cdot \left(x \cdot a\right)} \]
      4. distribute-lft-neg-in46.9%

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

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

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

    if 2.45000000000000013e-288 < t < 4.1999999999999997e-121

    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 b around inf 67.8%

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-out--30.2%

        \[\leadsto \color{blue}{1 \cdot x - \left(a \cdot b\right) \cdot x} \]
      2. *-un-lft-identity30.2%

        \[\leadsto \color{blue}{x} - \left(a \cdot b\right) \cdot x \]
      3. associate-*r*30.3%

        \[\leadsto x - \color{blue}{a \cdot \left(b \cdot x\right)} \]
      4. flip--29.7%

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}{x + a \cdot \left(b \cdot x\right)}} \]
      5. clear-num29.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{x + a \cdot \left(b \cdot x\right)}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}}} \]
      6. *-un-lft-identity29.6%

        \[\leadsto \frac{1}{\frac{\color{blue}{1 \cdot x} + a \cdot \left(b \cdot x\right)}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}} \]
      7. associate-*r*29.5%

        \[\leadsto \frac{1}{\frac{1 \cdot x + \color{blue}{\left(a \cdot b\right) \cdot x}}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}} \]
      8. distribute-rgt-out29.5%

        \[\leadsto \frac{1}{\frac{\color{blue}{x \cdot \left(1 + a \cdot b\right)}}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}} \]
      9. difference-of-squares29.5%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\color{blue}{\left(x + a \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}}} \]
      10. add-sqr-sqrt12.2%

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

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \color{blue}{\sqrt{a \cdot a}} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      12. sqr-neg26.6%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \sqrt{\color{blue}{\left(-a\right) \cdot \left(-a\right)}} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      13. sqrt-unprod14.4%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \color{blue}{\left(\sqrt{-a} \cdot \sqrt{-a}\right)} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      14. add-sqr-sqrt21.1%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \color{blue}{\left(-a\right)} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      15. cancel-sign-sub-inv21.1%

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

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\color{blue}{{\left(x - a \cdot \left(b \cdot x\right)\right)}^{2}}}} \]
    10. Applied egg-rr21.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{{\left(x \cdot \left(1 + a \cdot b\right)\right)}^{2}}}} \]
    11. Taylor expanded in a around 0 38.3%

      \[\leadsto \frac{1}{\color{blue}{-1 \cdot \frac{a \cdot b}{x} + \frac{1}{x}}} \]
    12. Step-by-step derivation
      1. +-commutative38.3%

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{x} + -1 \cdot \frac{a \cdot b}{x}}} \]
      2. mul-1-neg38.3%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{x} - \frac{a \cdot b}{x}}} \]
      4. div-sub38.3%

        \[\leadsto \frac{1}{\color{blue}{\frac{1 - a \cdot b}{x}}} \]
    13. Simplified38.3%

      \[\leadsto \frac{1}{\color{blue}{\frac{1 - a \cdot b}{x}}} \]

    if 4.1999999999999997e-121 < t < 3.8e6

    1. Initial program 100.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 58.6%

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

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

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

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

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

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

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

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

    if 3.8e6 < t

    1. Initial program 97.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 t around inf 83.5%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.1 \cdot 10^{+27}:\\ \;\;\;\;x \cdot e^{a \cdot b}\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-258}:\\ \;\;\;\;x \cdot e^{y \cdot t}\\ \mathbf{elif}\;t \leq 2.45 \cdot 10^{-288}:\\ \;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-121}:\\ \;\;\;\;\frac{1}{\frac{1 - a \cdot b}{x}}\\ \mathbf{elif}\;t \leq 3800000:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 29.9% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.7 \cdot 10^{-188}:\\ \;\;\;\;x \cdot e^{a \cdot b}\\ \mathbf{elif}\;t \leq 3900000:\\ \;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -3.7e-188)
   (* x (exp (* a b)))
   (if (<= t 3900000.0) (- x (* (+ z b) (* x a))) (* x (- 1.0 (* y t))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -3.7e-188) {
		tmp = x * exp((a * b));
	} else if (t <= 3900000.0) {
		tmp = x - ((z + b) * (x * a));
	} else {
		tmp = x * (1.0 - (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 (t <= (-3.7d-188)) then
        tmp = x * exp((a * b))
    else if (t <= 3900000.0d0) then
        tmp = x - ((z + b) * (x * a))
    else
        tmp = x * (1.0d0 - (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 (t <= -3.7e-188) {
		tmp = x * Math.exp((a * b));
	} else if (t <= 3900000.0) {
		tmp = x - ((z + b) * (x * a));
	} else {
		tmp = x * (1.0 - (y * t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -3.7e-188:
		tmp = x * math.exp((a * b))
	elif t <= 3900000.0:
		tmp = x - ((z + b) * (x * a))
	else:
		tmp = x * (1.0 - (y * t))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -3.7e-188)
		tmp = Float64(x * exp(Float64(a * b)));
	elseif (t <= 3900000.0)
		tmp = Float64(x - Float64(Float64(z + b) * Float64(x * a)));
	else
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -3.7e-188)
		tmp = x * exp((a * b));
	elseif (t <= 3900000.0)
		tmp = x - ((z + b) * (x * a));
	else
		tmp = x * (1.0 - (y * t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.7e-188], N[(x * N[Exp[N[(a * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3900000.0], N[(x - N[(N[(z + b), $MachinePrecision] * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{-188}:\\
\;\;\;\;x \cdot e^{a \cdot b}\\

\mathbf{elif}\;t \leq 3900000:\\
\;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.69999999999999972e-188

    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 b around inf 45.2%

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u45.2%

        \[\leadsto x \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{a \cdot \left(-b\right)}\right)\right)} \]
      2. expm1-udef45.2%

        \[\leadsto x \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(e^{a \cdot \left(-b\right)}\right)} - 1\right)} \]
      3. *-commutative45.2%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left(e^{\color{blue}{\left(-b\right) \cdot a}}\right)} - 1\right) \]
      4. exp-prod37.2%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{{\left(e^{-b}\right)}^{a}}\right)} - 1\right) \]
      5. add-sqr-sqrt17.2%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}\right)}^{a}\right)} - 1\right) \]
      6. sqrt-unprod26.0%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}\right)}^{a}\right)} - 1\right) \]
      7. sqr-neg26.0%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{\sqrt{\color{blue}{b \cdot b}}}\right)}^{a}\right)} - 1\right) \]
      8. sqrt-unprod8.7%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}\right)}^{a}\right)} - 1\right) \]
      9. add-sqr-sqrt18.5%

        \[\leadsto x \cdot \left(e^{\mathsf{log1p}\left({\left(e^{\color{blue}{b}}\right)}^{a}\right)} - 1\right) \]
    7. Applied egg-rr18.5%

      \[\leadsto x \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({\left(e^{b}\right)}^{a}\right)} - 1\right)} \]
    8. Step-by-step derivation
      1. expm1-def18.5%

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

        \[\leadsto x \cdot \color{blue}{{\left(e^{b}\right)}^{a}} \]
      3. exp-prod27.7%

        \[\leadsto x \cdot \color{blue}{e^{b \cdot a}} \]
      4. *-commutative27.7%

        \[\leadsto x \cdot e^{\color{blue}{a \cdot b}} \]
      5. exp-prod24.1%

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

      \[\leadsto x \cdot \color{blue}{{\left(e^{a}\right)}^{b}} \]
    10. Taylor expanded in a around inf 27.7%

      \[\leadsto x \cdot \color{blue}{e^{a \cdot b}} \]

    if -3.69999999999999972e-188 < t < 3.9e6

    1. Initial program 97.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 62.6%

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

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

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

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-1 \cdot z\right)} - b\right)} \]
      4. neg-mul-166.2%

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

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

      \[\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*66.2%

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

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

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

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

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

      \[\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-neg30.0%

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

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

        \[\leadsto x - \color{blue}{\left(x \cdot \left(b + z\right)\right) \cdot a} \]
      4. *-commutative30.0%

        \[\leadsto x - \color{blue}{\left(\left(b + z\right) \cdot x\right)} \cdot a \]
      5. associate-*l*31.2%

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

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

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

    if 3.9e6 < t

    1. Initial program 97.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 t around inf 83.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 33.1% accurate, 16.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{-83}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;y \leq 155000000000:\\ \;\;\;\;\frac{1}{\frac{1 - a \cdot b}{x}}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -8.2e-83)
   (* x (- 1.0 (* y t)))
   (if (<= y 155000000000.0) (/ 1.0 (/ (- 1.0 (* a b)) x)) (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -8.2e-83) {
		tmp = x * (1.0 - (y * t));
	} else if (y <= 155000000000.0) {
		tmp = 1.0 / ((1.0 - (a * b)) / x);
	} else {
		tmp = a * (x * -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 <= (-8.2d-83)) then
        tmp = x * (1.0d0 - (y * t))
    else if (y <= 155000000000.0d0) then
        tmp = 1.0d0 / ((1.0d0 - (a * b)) / x)
    else
        tmp = a * (x * -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 <= -8.2e-83) {
		tmp = x * (1.0 - (y * t));
	} else if (y <= 155000000000.0) {
		tmp = 1.0 / ((1.0 - (a * b)) / x);
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -8.2e-83:
		tmp = x * (1.0 - (y * t))
	elif y <= 155000000000.0:
		tmp = 1.0 / ((1.0 - (a * b)) / x)
	else:
		tmp = a * (x * -b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -8.2e-83)
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	elseif (y <= 155000000000.0)
		tmp = Float64(1.0 / Float64(Float64(1.0 - Float64(a * b)) / x));
	else
		tmp = Float64(a * Float64(x * Float64(-b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -8.2e-83)
		tmp = x * (1.0 - (y * t));
	elseif (y <= 155000000000.0)
		tmp = 1.0 / ((1.0 - (a * b)) / x);
	else
		tmp = a * (x * -b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8.2e-83], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 155000000000.0], N[(1.0 / N[(N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 155000000000:\\
\;\;\;\;\frac{1}{\frac{1 - a \cdot b}{x}}\\

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


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

    1. Initial program 100.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 63.3%

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

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

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

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

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

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

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

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

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

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

    if -8.1999999999999999e-83 < y < 1.55e11

    1. Initial program 93.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 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)}} \]
    6. Taylor expanded in a around 0 34.9%

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    8. Simplified34.9%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-out--34.9%

        \[\leadsto \color{blue}{1 \cdot x - \left(a \cdot b\right) \cdot x} \]
      2. *-un-lft-identity34.9%

        \[\leadsto \color{blue}{x} - \left(a \cdot b\right) \cdot x \]
      3. associate-*r*31.4%

        \[\leadsto x - \color{blue}{a \cdot \left(b \cdot x\right)} \]
      4. flip--28.8%

        \[\leadsto \color{blue}{\frac{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}{x + a \cdot \left(b \cdot x\right)}} \]
      5. clear-num28.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{x + a \cdot \left(b \cdot x\right)}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}}} \]
      6. *-un-lft-identity28.7%

        \[\leadsto \frac{1}{\frac{\color{blue}{1 \cdot x} + a \cdot \left(b \cdot x\right)}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}} \]
      7. associate-*r*27.7%

        \[\leadsto \frac{1}{\frac{1 \cdot x + \color{blue}{\left(a \cdot b\right) \cdot x}}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}} \]
      8. distribute-rgt-out27.7%

        \[\leadsto \frac{1}{\frac{\color{blue}{x \cdot \left(1 + a \cdot b\right)}}{x \cdot x - \left(a \cdot \left(b \cdot x\right)\right) \cdot \left(a \cdot \left(b \cdot x\right)\right)}} \]
      9. difference-of-squares28.7%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\color{blue}{\left(x + a \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}}} \]
      10. add-sqr-sqrt15.4%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      11. sqrt-unprod26.4%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \color{blue}{\sqrt{a \cdot a}} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      12. sqr-neg26.4%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \sqrt{\color{blue}{\left(-a\right) \cdot \left(-a\right)}} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      13. sqrt-unprod12.2%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \color{blue}{\left(\sqrt{-a} \cdot \sqrt{-a}\right)} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      14. add-sqr-sqrt25.4%

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\left(x + \color{blue}{\left(-a\right)} \cdot \left(b \cdot x\right)\right) \cdot \left(x - a \cdot \left(b \cdot x\right)\right)}} \]
      15. cancel-sign-sub-inv25.4%

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

        \[\leadsto \frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{\color{blue}{{\left(x - a \cdot \left(b \cdot x\right)\right)}^{2}}}} \]
    10. Applied egg-rr21.6%

      \[\leadsto \color{blue}{\frac{1}{\frac{x \cdot \left(1 + a \cdot b\right)}{{\left(x \cdot \left(1 + a \cdot b\right)\right)}^{2}}}} \]
    11. Taylor expanded in a around 0 40.5%

      \[\leadsto \frac{1}{\color{blue}{-1 \cdot \frac{a \cdot b}{x} + \frac{1}{x}}} \]
    12. Step-by-step derivation
      1. +-commutative40.5%

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{x} + -1 \cdot \frac{a \cdot b}{x}}} \]
      2. mul-1-neg40.5%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1}{x} - \frac{a \cdot b}{x}}} \]
      4. div-sub40.5%

        \[\leadsto \frac{1}{\color{blue}{\frac{1 - a \cdot b}{x}}} \]
    13. Simplified40.5%

      \[\leadsto \frac{1}{\color{blue}{\frac{1 - a \cdot b}{x}}} \]

    if 1.55e11 < y

    1. Initial program 96.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 b around inf 29.0%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    8. Simplified13.0%

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

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

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

        \[\leadsto \color{blue}{a \cdot \left(-b \cdot x\right)} \]
      3. distribute-rgt-neg-in27.5%

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

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

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

Alternative 12: 31.6% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.6 \cdot 10^{+172} \lor \neg \left(a \leq 2.8 \cdot 10^{+138}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.59999999999999975e172 or 2.8000000000000001e138 < a

    1. Initial program 94.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 b around inf 72.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. distribute-rgt-neg-in33.3%

        \[\leadsto \color{blue}{a \cdot \left(-b \cdot x\right)} \]
      3. distribute-rgt-neg-in33.3%

        \[\leadsto a \cdot \color{blue}{\left(b \cdot \left(-x\right)\right)} \]
    11. Simplified33.3%

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

    if -3.59999999999999975e172 < a < 2.8000000000000001e138

    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 59.5%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.6 \cdot 10^{+172} \lor \neg \left(a \leq 2.8 \cdot 10^{+138}\right):\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 32.8% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+19}:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\

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

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


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

    1. Initial program 100.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 28.4%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    8. Simplified11.6%

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

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

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. *-commutative14.0%

        \[\leadsto -\color{blue}{\left(b \cdot x\right) \cdot a} \]
      3. associate-*r*17.9%

        \[\leadsto -\color{blue}{b \cdot \left(x \cdot a\right)} \]
      4. distribute-lft-neg-in17.9%

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

        \[\leadsto \left(-b\right) \cdot \color{blue}{\left(a \cdot x\right)} \]
    11. Simplified17.9%

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

    if -1.6e19 < y < 0.320000000000000007

    1. Initial program 94.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 b around inf 77.3%

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

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

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

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

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

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

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

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

    if 0.320000000000000007 < y

    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 b around inf 29.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. distribute-rgt-neg-in26.3%

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot \left(-x\right)\right)} \]
    11. Simplified26.3%

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

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

Alternative 14: 25.1% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.75 \cdot 10^{+172} \lor \neg \left(a \leq 1.5 \cdot 10^{+107}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.74999999999999989e172 or 1.50000000000000012e107 < a

    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 b around inf 71.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. distribute-rgt-neg-in31.9%

        \[\leadsto \color{blue}{a \cdot \left(-b \cdot x\right)} \]
      3. distribute-rgt-neg-in31.9%

        \[\leadsto a \cdot \color{blue}{\left(b \cdot \left(-x\right)\right)} \]
    11. Simplified31.9%

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

    if -1.74999999999999989e172 < a < 1.50000000000000012e107

    1. Initial program 97.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 b around inf 44.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.75 \cdot 10^{+172} \lor \neg \left(a \leq 1.5 \cdot 10^{+107}\right):\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 27.8% accurate, 19.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+19}:\\ \;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;y \leq 155000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -1.6e+19)
   (* (- b) (* x a))
   (if (<= y 155000000000.0) x (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.6e+19) {
		tmp = -b * (x * a);
	} else if (y <= 155000000000.0) {
		tmp = x;
	} else {
		tmp = a * (x * -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.6d+19)) then
        tmp = -b * (x * a)
    else if (y <= 155000000000.0d0) then
        tmp = x
    else
        tmp = a * (x * -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.6e+19) {
		tmp = -b * (x * a);
	} else if (y <= 155000000000.0) {
		tmp = x;
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -1.6e+19:
		tmp = -b * (x * a)
	elif y <= 155000000000.0:
		tmp = x
	else:
		tmp = a * (x * -b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -1.6e+19)
		tmp = Float64(Float64(-b) * Float64(x * a));
	elseif (y <= 155000000000.0)
		tmp = x;
	else
		tmp = Float64(a * Float64(x * Float64(-b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -1.6e+19)
		tmp = -b * (x * a);
	elseif (y <= 155000000000.0)
		tmp = x;
	else
		tmp = a * (x * -b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.6e+19], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 155000000000.0], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+19}:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\

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

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


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

    1. Initial program 100.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 28.4%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    8. Simplified11.6%

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

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

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. *-commutative14.0%

        \[\leadsto -\color{blue}{\left(b \cdot x\right) \cdot a} \]
      3. associate-*r*17.9%

        \[\leadsto -\color{blue}{b \cdot \left(x \cdot a\right)} \]
      4. distribute-lft-neg-in17.9%

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

        \[\leadsto \left(-b\right) \cdot \color{blue}{\left(a \cdot x\right)} \]
    11. Simplified17.9%

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

    if -1.6e19 < y < 1.55e11

    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 b around inf 76.3%

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

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

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

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

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

    if 1.55e11 < y

    1. Initial program 96.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 b around inf 29.0%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    8. Simplified13.0%

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

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

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

        \[\leadsto \color{blue}{a \cdot \left(-b \cdot x\right)} \]
      3. distribute-rgt-neg-in27.5%

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot \left(-x\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification25.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+19}:\\ \;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;y \leq 155000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 19.9% 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 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 b around inf 52.3%

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

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

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

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

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

    \[\leadsto x \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2024017 
(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))))))