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

Percentage Accurate: 96.4% → 99.5%
Time: 18.7s
Alternatives: 18
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 18 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.5% 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 97.1%

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

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

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

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

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

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

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

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

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

Alternative 3: 86.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{-110} \lor \neg \left(y \leq 3.25 \cdot 10^{-38}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.3000000000000001e-110 or 3.24999999999999975e-38 < y

    1. Initial program 98.1%

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

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

    if -2.3000000000000001e-110 < y < 3.24999999999999975e-38

    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. Taylor expanded in y around 0 91.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-a \cdot b\right)} - a \cdot z} \]
      4. distribute-rgt-neg-in97.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{-110} \lor \neg \left(y \leq 3.25 \cdot 10^{-38}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right) - z \cdot a}\\ \end{array} \]

Alternative 4: 75.8% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot {z}^{y}\\ \mathbf{if}\;y \leq -25000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{+28}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right) - z \cdot a}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+62} \lor \neg \left(y \leq 1.3 \cdot 10^{+155}\right):\\ \;\;\;\;t_1\\ \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 z y))))
   (if (<= y -25000.0)
     t_1
     (if (<= y 1.06e+28)
       (* x (exp (- (* a (- b)) (* z a))))
       (if (or (<= y 7.2e+62) (not (<= y 1.3e+155)))
         t_1
         (* x (exp (* t (- y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * pow(z, y);
	double tmp;
	if (y <= -25000.0) {
		tmp = t_1;
	} else if (y <= 1.06e+28) {
		tmp = x * exp(((a * -b) - (z * a)));
	} else if ((y <= 7.2e+62) || !(y <= 1.3e+155)) {
		tmp = t_1;
	} 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 * (z ** y)
    if (y <= (-25000.0d0)) then
        tmp = t_1
    else if (y <= 1.06d+28) then
        tmp = x * exp(((a * -b) - (z * a)))
    else if ((y <= 7.2d+62) .or. (.not. (y <= 1.3d+155))) then
        tmp = t_1
    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(z, y);
	double tmp;
	if (y <= -25000.0) {
		tmp = t_1;
	} else if (y <= 1.06e+28) {
		tmp = x * Math.exp(((a * -b) - (z * a)));
	} else if ((y <= 7.2e+62) || !(y <= 1.3e+155)) {
		tmp = t_1;
	} else {
		tmp = x * Math.exp((t * -y));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.pow(z, y)
	tmp = 0
	if y <= -25000.0:
		tmp = t_1
	elif y <= 1.06e+28:
		tmp = x * math.exp(((a * -b) - (z * a)))
	elif (y <= 7.2e+62) or not (y <= 1.3e+155):
		tmp = t_1
	else:
		tmp = x * math.exp((t * -y))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * (z ^ y))
	tmp = 0.0
	if (y <= -25000.0)
		tmp = t_1;
	elseif (y <= 1.06e+28)
		tmp = Float64(x * exp(Float64(Float64(a * Float64(-b)) - Float64(z * a))));
	elseif ((y <= 7.2e+62) || !(y <= 1.3e+155))
		tmp = t_1;
	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 * (z ^ y);
	tmp = 0.0;
	if (y <= -25000.0)
		tmp = t_1;
	elseif (y <= 1.06e+28)
		tmp = x * exp(((a * -b) - (z * a)));
	elseif ((y <= 7.2e+62) || ~((y <= 1.3e+155)))
		tmp = t_1;
	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[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -25000.0], t$95$1, If[LessEqual[y, 1.06e+28], N[(x * N[Exp[N[(N[(a * (-b)), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 7.2e+62], N[Not[LessEqual[y, 1.3e+155]], $MachinePrecision]], t$95$1, N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -25000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 7.2 \cdot 10^{+62} \lor \neg \left(y \leq 1.3 \cdot 10^{+155}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -25000 or 1.0600000000000001e28 < y < 7.2e62 or 1.3000000000000001e155 < y

    1. Initial program 97.4%

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

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

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

    if -25000 < y < 1.0600000000000001e28

    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. Taylor expanded in y around 0 84.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-a \cdot b\right)} - a \cdot z} \]
      4. distribute-rgt-neg-in88.5%

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

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

    if 7.2e62 < y < 1.3000000000000001e155

    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. Taylor expanded in t around inf 66.2%

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative66.2%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified66.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -25000:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{+28}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right) - z \cdot a}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+62} \lor \neg \left(y \leq 1.3 \cdot 10^{+155}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \end{array} \]

Alternative 5: 72.0% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-6} \lor \neg \left(t \leq 1.4 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.99999999999999964e-6 or 1.39999999999999992e-9 < t

    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. Taylor expanded in t around inf 76.7%

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative76.7%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified76.7%

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

    if -7.99999999999999964e-6 < t < 1.39999999999999992e-9

    1. Initial program 99.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8 \cdot 10^{-6} \lor \neg \left(t \leq 1.4 \cdot 10^{-9}\right):\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]

Alternative 6: 73.8% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -760 \lor \neg \left(y \leq 1.4 \cdot 10^{+27}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -760 or 1.4e27 < y

    1. Initial program 97.7%

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

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

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

    if -760 < y < 1.4e27

    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. Taylor expanded in b around inf 83.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -760 \lor \neg \left(y \leq 1.4 \cdot 10^{+27}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \]

Alternative 7: 55.4% accurate, 3.0× speedup?

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

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

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


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

    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. Taylor expanded in t around inf 84.6%

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative84.6%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified84.6%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 34.4%

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

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

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

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

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

    if -2.3999999999999999e42 < t

    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. Taylor expanded in y around inf 68.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.4 \cdot 10^{+42}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]

Alternative 8: 31.0% accurate, 28.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{+150} \lor \neg \left(b \leq 5 \cdot 10^{+23}\right):\\ \;\;\;\;x - a \cdot \left(x \cdot b\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 (<= b -1.8e+150) (not (<= b 5e+23)))
   (- x (* 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 ((b <= -1.8e+150) || !(b <= 5e+23)) {
		tmp = x - (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 ((b <= (-1.8d+150)) .or. (.not. (b <= 5d+23))) then
        tmp = x - (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 ((b <= -1.8e+150) || !(b <= 5e+23)) {
		tmp = x - (a * (x * b));
	} else {
		tmp = x * (1.0 - (y * t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (b <= -1.8e+150) or not (b <= 5e+23):
		tmp = x - (a * (x * b))
	else:
		tmp = x * (1.0 - (y * t))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((b <= -1.8e+150) || !(b <= 5e+23))
		tmp = Float64(x - Float64(a * Float64(x * 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 ((b <= -1.8e+150) || ~((b <= 5e+23)))
		tmp = x - (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[b, -1.8e+150], N[Not[LessEqual[b, 5e+23]], $MachinePrecision]], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{+150} \lor \neg \left(b \leq 5 \cdot 10^{+23}\right):\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.79999999999999993e150 or 4.9999999999999999e23 < b

    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. Taylor expanded in b around inf 82.2%

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

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

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

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

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

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

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

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

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

    if -1.79999999999999993e150 < b < 4.9999999999999999e23

    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. Taylor expanded in t around inf 66.3%

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative66.3%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified66.3%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 35.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{+150} \lor \neg \left(b \leq 5 \cdot 10^{+23}\right):\\ \;\;\;\;x - a \cdot \left(x \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \end{array} \]

Alternative 9: 30.4% accurate, 28.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.6 \cdot 10^{+148} \lor \neg \left(b \leq 3.65 \cdot 10^{+28}\right):\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.6000000000000001e148 or 3.6499999999999999e28 < b

    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. Taylor expanded in b around inf 82.0%

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

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

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

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

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

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

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

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

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

    if -4.6000000000000001e148 < b < 3.6499999999999999e28

    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. Taylor expanded in t around inf 66.5%

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative66.5%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified66.5%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 35.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.6 \cdot 10^{+148} \lor \neg \left(b \leq 3.65 \cdot 10^{+28}\right):\\ \;\;\;\;x - a \cdot \left(x \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \end{array} \]

Alternative 10: 30.4% accurate, 28.3× speedup?

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

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

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

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


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

    1. Initial program 98.6%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative56.8%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified56.8%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 16.4%

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

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

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

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

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

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

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

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

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

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

    if -1.69999999999999996e23 < y < 14

    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. Taylor expanded in y around 0 82.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 14 < y

    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. Taylor expanded in y around 0 35.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \left(x \cdot z\right)} \]
      2. neg-mul-135.8%

        \[\leadsto \color{blue}{\left(-a\right)} \cdot \left(x \cdot z\right) \]
      3. *-commutative35.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+23}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 14:\\ \;\;\;\;x \cdot \left(1 - z \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 11: 34.9% accurate, 28.3× speedup?

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

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

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

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


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

    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. Taylor expanded in t around inf 70.3%

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative70.3%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified70.3%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 21.6%

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

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

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

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

    if -1.9000000000000001e130 < y < 1750

    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. Taylor expanded in b around inf 76.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1750 < y

    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. Taylor expanded in y around 0 35.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \left(x \cdot z\right)} \]
      2. neg-mul-135.8%

        \[\leadsto \color{blue}{\left(-a\right)} \cdot \left(x \cdot z\right) \]
      3. *-commutative35.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+130}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 1750:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 12: 27.0% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2900000000000 \lor \neg \left(y \leq 2.2 \cdot 10^{+28}\right):\\
\;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.9e12 or 2.19999999999999986e28 < y

    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. Taylor expanded in y around 0 43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot z\right) \cdot \left(-a\right)} \]
      4. *-commutative22.5%

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

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

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

    if -2.9e12 < y < 2.19999999999999986e28

    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. Taylor expanded in t around inf 54.5%

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative54.5%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified54.5%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 38.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2900000000000 \lor \neg \left(y \leq 2.2 \cdot 10^{+28}\right):\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 13: 28.4% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2900000000000:\\
\;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\

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

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


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

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9e12 < y < 14

    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. Taylor expanded in t around inf 55.4%

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative55.4%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified55.4%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 39.7%

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

    if 14 < y

    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. Taylor expanded in y around 0 35.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \left(x \cdot z\right)} \]
      2. neg-mul-135.8%

        \[\leadsto \color{blue}{\left(-a\right)} \cdot \left(x \cdot z\right) \]
      3. *-commutative35.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2900000000000:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 14:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 14: 30.1% accurate, 31.1× speedup?

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

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

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

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


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

    1. Initial program 98.6%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative57.5%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified57.5%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 16.5%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{x \cdot \left(y \cdot t\right)} \]
      4. distribute-lft-neg-in17.6%

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

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

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

    if -3.8000000000000001e30 < y < 14

    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. Taylor expanded in t around inf 54.6%

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative54.6%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified54.6%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 39.1%

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

    if 14 < y

    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. Taylor expanded in y around 0 35.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \left(x \cdot z\right)} \]
      2. neg-mul-135.8%

        \[\leadsto \color{blue}{\left(-a\right)} \cdot \left(x \cdot z\right) \]
      3. *-commutative35.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{+30}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 14:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 15: 29.9% accurate, 31.1× speedup?

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

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

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

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


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

    1. Initial program 98.6%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative57.5%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified57.5%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 16.5%

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

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

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

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

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

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

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

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

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

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

    if -1.8000000000000001e30 < y < 14

    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. Taylor expanded in t around inf 54.6%

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative54.6%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified54.6%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 39.1%

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

    if 14 < y

    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. Taylor expanded in y around 0 35.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \left(x \cdot z\right)} \]
      2. neg-mul-135.8%

        \[\leadsto \color{blue}{\left(-a\right)} \cdot \left(x \cdot z\right) \]
      3. *-commutative35.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+30}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 14:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 16: 21.9% accurate, 34.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+77} \lor \neg \left(a \leq 8.2 \cdot 10^{+100}\right):\\
\;\;\;\;x \cdot \left(y \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.3999999999999999e77 or 8.2000000000000006e100 < a

    1. Initial program 92.2%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative32.6%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified32.6%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 7.4%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{x \cdot \left(y \cdot t\right)} \]
      4. distribute-lft-neg-in18.5%

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(t \cdot y\right) \cdot \left(-x\right)}\right)} - 1 \]
      4. associate-*l*29.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(y \cdot t\right)} \cdot x \]
    14. Simplified20.5%

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

    if -2.3999999999999999e77 < a < 8.2000000000000006e100

    1. Initial program 99.8%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative65.1%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified65.1%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 30.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.4 \cdot 10^{+77} \lor \neg \left(a \leq 8.2 \cdot 10^{+100}\right):\\ \;\;\;\;x \cdot \left(y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 17: 30.9% accurate, 34.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 16.5

    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. Taylor expanded in t around inf 55.6%

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

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative55.6%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified55.6%

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 32.6%

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

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

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

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

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

    if 16.5 < y

    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. Taylor expanded in y around 0 35.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \left(x \cdot z\right)} \]
      2. neg-mul-135.8%

        \[\leadsto \color{blue}{\left(-a\right)} \cdot \left(x \cdot z\right) \]
      3. *-commutative35.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 16.5:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 18: 19.7% 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 97.1%

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

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

      \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
    2. *-commutative53.8%

      \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
  4. Simplified53.8%

    \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
  5. Taylor expanded in y around 0 21.4%

    \[\leadsto \color{blue}{x} \]
  6. Final simplification21.4%

    \[\leadsto x \]

Reproduce

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