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

Percentage Accurate: 96.5% → 99.5%
Time: 17.6s
Alternatives: 20
Speedup: 1.4×

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 20 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.5% 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 96.9%

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

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

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

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

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

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

Alternative 2: 99.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(z \cdot \left(z \cdot -0.5 + -1\right) - b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (* z (+ (* z -0.5) -1.0)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) + (a * ((z * ((z * -0.5) + -1.0)) - 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 * ((z * ((z * (-0.5d0)) + (-1.0d0))) - 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 * ((z * ((z * -0.5) + -1.0)) - b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * ((z * ((z * -0.5) + -1.0)) - b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(Float64(z * Float64(Float64(z * -0.5) + -1.0)) - b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * ((z * ((z * -0.5) + -1.0)) - 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[(z * N[(N[(z * -0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{z \cdot \left(-0.5 \cdot z - 1\right)} - b\right)} \]
  4. Final simplification99.2%

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

Alternative 3: 86.8% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-20} \lor \neg \left(y \leq 8.8 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.79999999999999987e-20 or 8.7999999999999994e-8 < y

    1. Initial program 98.5%

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

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

    if -1.79999999999999987e-20 < y < 8.7999999999999994e-8

    1. Initial program 94.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{-20} \lor \neg \left(y \leq 8.8 \cdot 10^{-8}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(z \cdot \left(z \cdot -0.5 + -1\right) - b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.3% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{if}\;t \leq -1.7 \cdot 10^{+33}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.2 \cdot 10^{-65}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-112}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{+50}:\\ \;\;\;\;x \cdot e^{a \cdot \left(z \cdot \left(z \cdot -0.5 + -1\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (exp (* y (- t))))))
   (if (<= t -1.7e+33)
     t_1
     (if (<= t -1.2e-65)
       (* x (exp (* a (- (- z) b))))
       (if (<= t -1.35e-112)
         (* x (pow z y))
         (if (<= t 2.25e+50)
           (* x (exp (* a (- (* z (+ (* z -0.5) -1.0)) b))))
           t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * exp((y * -t));
	double tmp;
	if (t <= -1.7e+33) {
		tmp = t_1;
	} else if (t <= -1.2e-65) {
		tmp = x * exp((a * (-z - b)));
	} else if (t <= -1.35e-112) {
		tmp = x * pow(z, y);
	} else if (t <= 2.25e+50) {
		tmp = x * exp((a * ((z * ((z * -0.5) + -1.0)) - b)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * exp((y * -t))
    if (t <= (-1.7d+33)) then
        tmp = t_1
    else if (t <= (-1.2d-65)) then
        tmp = x * exp((a * (-z - b)))
    else if (t <= (-1.35d-112)) then
        tmp = x * (z ** y)
    else if (t <= 2.25d+50) then
        tmp = x * exp((a * ((z * ((z * (-0.5d0)) + (-1.0d0))) - b)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * Math.exp((y * -t));
	double tmp;
	if (t <= -1.7e+33) {
		tmp = t_1;
	} else if (t <= -1.2e-65) {
		tmp = x * Math.exp((a * (-z - b)));
	} else if (t <= -1.35e-112) {
		tmp = x * Math.pow(z, y);
	} else if (t <= 2.25e+50) {
		tmp = x * Math.exp((a * ((z * ((z * -0.5) + -1.0)) - b)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.exp((y * -t))
	tmp = 0
	if t <= -1.7e+33:
		tmp = t_1
	elif t <= -1.2e-65:
		tmp = x * math.exp((a * (-z - b)))
	elif t <= -1.35e-112:
		tmp = x * math.pow(z, y)
	elif t <= 2.25e+50:
		tmp = x * math.exp((a * ((z * ((z * -0.5) + -1.0)) - b)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * exp(Float64(y * Float64(-t))))
	tmp = 0.0
	if (t <= -1.7e+33)
		tmp = t_1;
	elseif (t <= -1.2e-65)
		tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b))));
	elseif (t <= -1.35e-112)
		tmp = Float64(x * (z ^ y));
	elseif (t <= 2.25e+50)
		tmp = Float64(x * exp(Float64(a * Float64(Float64(z * Float64(Float64(z * -0.5) + -1.0)) - b))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * exp((y * -t));
	tmp = 0.0;
	if (t <= -1.7e+33)
		tmp = t_1;
	elseif (t <= -1.2e-65)
		tmp = x * exp((a * (-z - b)));
	elseif (t <= -1.35e-112)
		tmp = x * (z ^ y);
	elseif (t <= 2.25e+50)
		tmp = x * exp((a * ((z * ((z * -0.5) + -1.0)) - b)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e+33], t$95$1, If[LessEqual[t, -1.2e-65], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.35e-112], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.25e+50], N[(x * N[Exp[N[(a * N[(N[(z * N[(N[(z * -0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;t \leq 2.25 \cdot 10^{+50}:\\
\;\;\;\;x \cdot e^{a \cdot \left(z \cdot \left(z \cdot -0.5 + -1\right) - b\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.7e33 or 2.25000000000000007e50 < t

    1. Initial program 97.6%

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

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

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

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

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

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

    if -1.7e33 < t < -1.2000000000000001e-65

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

    if -1.2000000000000001e-65 < t < -1.35e-112

    1. Initial program 100.0%

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

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

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

    if -1.35e-112 < t < 2.25000000000000007e50

    1. Initial program 95.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{+33}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq -1.2 \cdot 10^{-65}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-112}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{+50}:\\ \;\;\;\;x \cdot e^{a \cdot \left(z \cdot \left(z \cdot -0.5 + -1\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 75.3% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;t \leq -5.5 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.45 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.4000000000000001e35 or 1.45e50 < t

    1. Initial program 97.6%

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

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

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

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

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

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

    if -3.4000000000000001e35 < t < -5.50000000000000006e-69 or -5.5000000000000003e-109 < t < 1.45e50

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000006e-69 < t < -5.5000000000000003e-109

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.4 \cdot 10^{+35}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq -5.5 \cdot 10^{-69}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{elif}\;t \leq -5.5 \cdot 10^{-109}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{+50}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 72.4% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -400000000000 \lor \neg \left(y \leq 7.2 \cdot 10^{+34}\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 -400000000000.0) (not (<= y 7.2e+34)))
   (* 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 <= -400000000000.0) || !(y <= 7.2e+34)) {
		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 <= (-400000000000.0d0)) .or. (.not. (y <= 7.2d+34))) 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 <= -400000000000.0) || !(y <= 7.2e+34)) {
		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 <= -400000000000.0) or not (y <= 7.2e+34):
		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 <= -400000000000.0) || !(y <= 7.2e+34))
		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 <= -400000000000.0) || ~((y <= 7.2e+34)))
		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, -400000000000.0], N[Not[LessEqual[y, 7.2e+34]], $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 -400000000000 \lor \neg \left(y \leq 7.2 \cdot 10^{+34}\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 < -4e11 or 7.2000000000000001e34 < y

    1. Initial program 98.3%

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

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

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

    if -4e11 < y < 7.2000000000000001e34

    1. Initial program 95.8%

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

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

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

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

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

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

Alternative 7: 71.1% accurate, 2.7× speedup?

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

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

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

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


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

    1. Initial program 96.3%

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

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

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

    if -7.5e11 < y < 0.0290000000000000015

    1. Initial program 95.4%

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

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

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

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

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

    if 0.0290000000000000015 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

Alternative 8: 54.2% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+105}:\\ \;\;\;\;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 -1.2e+105) (* 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 <= -1.2e+105) {
		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 <= (-1.2d+105)) 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 <= -1.2e+105) {
		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 <= -1.2e+105:
		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 <= -1.2e+105)
		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 <= -1.2e+105)
		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, -1.2e+105], 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 -1.2 \cdot 10^{+105}:\\
\;\;\;\;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 < -1.19999999999999987e105

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999987e105 < t

    1. Initial program 96.4%

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

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

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

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

Alternative 9: 25.3% accurate, 10.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.45 \cdot 10^{-186}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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

\mathbf{elif}\;x \leq 4.2 \cdot 10^{+99}:\\
\;\;\;\;z \cdot \left(\frac{x - a \cdot \left(x \cdot b\right)}{z} - x \cdot a\right)\\

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


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

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.4500000000000001e-186 < x < 8e-79

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

    if 8e-79 < x < 4.2000000000000002e99

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000002e99 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 31.0% accurate, 12.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.65 \cdot 10^{+190}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\

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

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


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

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.65e190 < b < 5.99999999999999958e136

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

    if 5.99999999999999958e136 < b

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 30.7% accurate, 13.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+190}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\

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

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


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

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.0000000000000003e190 < b < 4.4e173

    1. Initial program 96.7%

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg34.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) \]
    8. Simplified34.4%

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

    if 4.4e173 < b

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 30.5% accurate, 16.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+194}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\

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

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


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

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999989e194 < b < 1.05e136

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e136 < b

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 33.8% accurate, 16.6× speedup?

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

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

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

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


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

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

    if -1.70000000000000001e-51 < y < 6.90000000000000037e34

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.90000000000000037e34 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 29.8% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -9 \cdot 10^{+191}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\

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

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


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

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000005e191 < b < 6.7999999999999996e141

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

    if 6.7999999999999996e141 < b

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 28.4% accurate, 19.6× speedup?

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

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

\mathbf{elif}\;y \leq 4.8 \cdot 10^{-57}:\\
\;\;\;\;x\\

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


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

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5e11 < y < 4.80000000000000012e-57

    1. Initial program 95.1%

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

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

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

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

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

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

    if 4.80000000000000012e-57 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 28.5% accurate, 19.6× speedup?

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

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

\mathbf{elif}\;y \leq 2.5 \cdot 10^{-56}:\\
\;\;\;\;x\\

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


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

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5e11 < y < 2.49999999999999999e-56

    1. Initial program 95.1%

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

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

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

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

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

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

    if 2.49999999999999999e-56 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 32.5% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

    if 6.90000000000000037e34 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 25.4% accurate, 28.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{-57}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.30000000000000022e-57

    1. Initial program 95.5%

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

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

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

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

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

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

    if 4.30000000000000022e-57 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 22.2% accurate, 31.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.9 \cdot 10^{-56}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.89999999999999991e-56

    1. Initial program 95.5%

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

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

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

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

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

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

    if 2.89999999999999991e-56 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - a \cdot \left(b \cdot x\right)} \]
    9. Step-by-step derivation
      1. cancel-sign-sub-inv9.4%

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

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

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

        \[\leadsto x + \sqrt{\color{blue}{a \cdot a}} \cdot \left(b \cdot x\right) \]
      5. sqrt-unprod1.3%

        \[\leadsto x + \color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)} \cdot \left(b \cdot x\right) \]
      6. add-sqr-sqrt5.3%

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

        \[\leadsto x + \color{blue}{\left(a \cdot b\right) \cdot x} \]
      8. distribute-rgt1-in2.9%

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

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

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

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

Alternative 20: 19.4% accurate, 315.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 96.9%

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

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

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

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

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

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

    \[\leadsto x \]
  8. Add Preprocessing

Reproduce

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