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

Percentage Accurate: 96.6% → 99.5%
Time: 30.7s
Alternatives: 20
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.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 95.1%

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

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

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

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

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

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

Alternative 2: 96.6% accurate, 1.0× speedup?

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

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Derivation
  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. Final simplification95.1%

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

Alternative 3: 87.3% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.85000000000000001e-24 or 1.79999999999999988e-54 < y

    1. Initial program 99.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 87.6%

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

    if -2.85000000000000001e-24 < y < 1.79999999999999988e-54

    1. Initial program 89.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 81.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 43.0% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := e^{a \cdot \left(-b\right)}\\ t_2 := e^{y \cdot \left(-t\right)}\\ \mathbf{if}\;y \leq -1.75 \cdot 10^{-31}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-118}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{-195}:\\ \;\;\;\;x - y \cdot \left(x \cdot t\right)\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-274}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{-68}:\\ \;\;\;\;x - x \cdot \left(a \cdot \left(z + b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (exp (* a (- b)))) (t_2 (exp (* y (- t)))))
   (if (<= y -1.75e-31)
     t_2
     (if (<= y -8.5e-118)
       t_1
       (if (<= y -9.2e-195)
         (- x (* y (* x t)))
         (if (<= y -7.5e-274)
           t_1
           (if (<= y 2.25e-68) (- x (* x (* a (+ z b)))) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = exp((a * -b));
	double t_2 = exp((y * -t));
	double tmp;
	if (y <= -1.75e-31) {
		tmp = t_2;
	} else if (y <= -8.5e-118) {
		tmp = t_1;
	} else if (y <= -9.2e-195) {
		tmp = x - (y * (x * t));
	} else if (y <= -7.5e-274) {
		tmp = t_1;
	} else if (y <= 2.25e-68) {
		tmp = x - (x * (a * (z + b)));
	} 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 = exp((a * -b))
    t_2 = exp((y * -t))
    if (y <= (-1.75d-31)) then
        tmp = t_2
    else if (y <= (-8.5d-118)) then
        tmp = t_1
    else if (y <= (-9.2d-195)) then
        tmp = x - (y * (x * t))
    else if (y <= (-7.5d-274)) then
        tmp = t_1
    else if (y <= 2.25d-68) then
        tmp = x - (x * (a * (z + b)))
    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 = Math.exp((a * -b));
	double t_2 = Math.exp((y * -t));
	double tmp;
	if (y <= -1.75e-31) {
		tmp = t_2;
	} else if (y <= -8.5e-118) {
		tmp = t_1;
	} else if (y <= -9.2e-195) {
		tmp = x - (y * (x * t));
	} else if (y <= -7.5e-274) {
		tmp = t_1;
	} else if (y <= 2.25e-68) {
		tmp = x - (x * (a * (z + b)));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = math.exp((a * -b))
	t_2 = math.exp((y * -t))
	tmp = 0
	if y <= -1.75e-31:
		tmp = t_2
	elif y <= -8.5e-118:
		tmp = t_1
	elif y <= -9.2e-195:
		tmp = x - (y * (x * t))
	elif y <= -7.5e-274:
		tmp = t_1
	elif y <= 2.25e-68:
		tmp = x - (x * (a * (z + b)))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = exp(Float64(a * Float64(-b)))
	t_2 = exp(Float64(y * Float64(-t)))
	tmp = 0.0
	if (y <= -1.75e-31)
		tmp = t_2;
	elseif (y <= -8.5e-118)
		tmp = t_1;
	elseif (y <= -9.2e-195)
		tmp = Float64(x - Float64(y * Float64(x * t)));
	elseif (y <= -7.5e-274)
		tmp = t_1;
	elseif (y <= 2.25e-68)
		tmp = Float64(x - Float64(x * Float64(a * Float64(z + b))));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = exp((a * -b));
	t_2 = exp((y * -t));
	tmp = 0.0;
	if (y <= -1.75e-31)
		tmp = t_2;
	elseif (y <= -8.5e-118)
		tmp = t_1;
	elseif (y <= -9.2e-195)
		tmp = x - (y * (x * t));
	elseif (y <= -7.5e-274)
		tmp = t_1;
	elseif (y <= 2.25e-68)
		tmp = x - (x * (a * (z + b)));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -1.75e-31], t$95$2, If[LessEqual[y, -8.5e-118], t$95$1, If[LessEqual[y, -9.2e-195], N[(x - N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.5e-274], t$95$1, If[LessEqual[y, 2.25e-68], N[(x - N[(x * N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -8.5 \cdot 10^{-118}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq -7.5 \cdot 10^{-274}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.74999999999999993e-31 or 2.25e-68 < y

    1. Initial program 99.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. Step-by-step derivation
      1. add-exp-log70.8%

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right) + \log x}} \]
    5. Taylor expanded in t around inf 44.1%

      \[\leadsto e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. associate-*r*44.1%

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

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

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

    if -1.74999999999999993e-31 < y < -8.50000000000000087e-118 or -9.2000000000000007e-195 < y < -7.49999999999999968e-274

    1. Initial program 88.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. Step-by-step derivation
      1. add-exp-log62.5%

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

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

        \[\leadsto e^{\color{blue}{\log \left(e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\right) + \log x}} \]
    4. Applied egg-rr40.3%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right) + \log x}} \]
    5. Taylor expanded in b around inf 54.1%

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

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

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

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

    if -8.50000000000000087e-118 < y < -9.2000000000000007e-195

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999968e-274 < y < 2.25e-68

    1. Initial program 89.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 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{-31}:\\ \;\;\;\;e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-118}:\\ \;\;\;\;e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;y \leq -9.2 \cdot 10^{-195}:\\ \;\;\;\;x - y \cdot \left(x \cdot t\right)\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-274}:\\ \;\;\;\;e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{-68}:\\ \;\;\;\;x - x \cdot \left(a \cdot \left(z + b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y \cdot \left(-t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 55.7% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot {z}^{y}\\ t_2 := e^{y \cdot \left(-t\right)}\\ \mathbf{if}\;t \leq -5 \cdot 10^{+25}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -2.15 \cdot 10^{-191}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{-266}:\\ \;\;\;\;e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{+87}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (pow z y))) (t_2 (exp (* y (- t)))))
   (if (<= t -5e+25)
     t_2
     (if (<= t -2.15e-191)
       t_1
       (if (<= t 1.6e-266) (exp (* a (- b))) (if (<= t 1.22e+87) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * pow(z, y);
	double t_2 = exp((y * -t));
	double tmp;
	if (t <= -5e+25) {
		tmp = t_2;
	} else if (t <= -2.15e-191) {
		tmp = t_1;
	} else if (t <= 1.6e-266) {
		tmp = exp((a * -b));
	} else if (t <= 1.22e+87) {
		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 * (z ** y)
    t_2 = exp((y * -t))
    if (t <= (-5d+25)) then
        tmp = t_2
    else if (t <= (-2.15d-191)) then
        tmp = t_1
    else if (t <= 1.6d-266) then
        tmp = exp((a * -b))
    else if (t <= 1.22d+87) 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.pow(z, y);
	double t_2 = Math.exp((y * -t));
	double tmp;
	if (t <= -5e+25) {
		tmp = t_2;
	} else if (t <= -2.15e-191) {
		tmp = t_1;
	} else if (t <= 1.6e-266) {
		tmp = Math.exp((a * -b));
	} else if (t <= 1.22e+87) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.pow(z, y)
	t_2 = math.exp((y * -t))
	tmp = 0
	if t <= -5e+25:
		tmp = t_2
	elif t <= -2.15e-191:
		tmp = t_1
	elif t <= 1.6e-266:
		tmp = math.exp((a * -b))
	elif t <= 1.22e+87:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * (z ^ y))
	t_2 = exp(Float64(y * Float64(-t)))
	tmp = 0.0
	if (t <= -5e+25)
		tmp = t_2;
	elseif (t <= -2.15e-191)
		tmp = t_1;
	elseif (t <= 1.6e-266)
		tmp = exp(Float64(a * Float64(-b)));
	elseif (t <= 1.22e+87)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * (z ^ y);
	t_2 = exp((y * -t));
	tmp = 0.0;
	if (t <= -5e+25)
		tmp = t_2;
	elseif (t <= -2.15e-191)
		tmp = t_1;
	elseif (t <= 1.6e-266)
		tmp = exp((a * -b));
	elseif (t <= 1.22e+87)
		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[Power[z, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -5e+25], t$95$2, If[LessEqual[t, -2.15e-191], t$95$1, If[LessEqual[t, 1.6e-266], N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 1.22e+87], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -2.15 \cdot 10^{-191}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.22 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.00000000000000024e25 or 1.2200000000000001e87 < t

    1. Initial program 97.3%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-exp-log67.8%

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

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

        \[\leadsto e^{\color{blue}{\log \left(e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\right) + \log x}} \]
    4. Applied egg-rr42.5%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right) + \log x}} \]
    5. Taylor expanded in t around inf 54.1%

      \[\leadsto e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. associate-*r*54.1%

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

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

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

    if -5.00000000000000024e25 < t < -2.14999999999999992e-191 or 1.6e-266 < t < 1.2200000000000001e87

    1. Initial program 93.5%

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

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

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

    if -2.14999999999999992e-191 < t < 1.6e-266

    1. Initial program 93.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-exp-log66.4%

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

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

        \[\leadsto e^{\color{blue}{\log \left(e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\right) + \log x}} \]
    4. Applied egg-rr42.5%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right) + \log x}} \]
    5. Taylor expanded in b around inf 50.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{+25}:\\ \;\;\;\;e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq -2.15 \cdot 10^{-191}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{-266}:\\ \;\;\;\;e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{+87}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;e^{y \cdot \left(-t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 72.0% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+26} \lor \neg \left(y \leq 1.75 \cdot 10^{-54}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.99999999999999957e26 or 1.74999999999999991e-54 < y

    1. Initial program 99.2%

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

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

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

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

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

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

    if -8.99999999999999957e26 < y < 1.74999999999999991e-54

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 62.5% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+77} \lor \neg \left(y \leq 1.15\right):\\
\;\;\;\;e^{y \cdot \left(-t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.5000000000000001e77 or 1.1499999999999999 < y

    1. Initial program 99.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. Step-by-step derivation
      1. add-exp-log74.1%

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

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

        \[\leadsto e^{\color{blue}{\log \left(e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\right) + \log x}} \]
    4. Applied egg-rr45.5%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right) + \log x}} \]
    5. Taylor expanded in t around inf 48.9%

      \[\leadsto e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    6. Step-by-step derivation
      1. associate-*r*48.9%

        \[\leadsto e^{\color{blue}{\left(-1 \cdot t\right) \cdot y}} \]
      2. mul-1-neg48.9%

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

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

    if -3.5000000000000001e77 < y < 1.1499999999999999

    1. Initial program 91.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 75.2%

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

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

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

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

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

Alternative 8: 69.0% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-30} \lor \neg \left(y \leq 9.5 \cdot 10^{-56}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.44999999999999995e-30 or 9.4999999999999991e-56 < y

    1. Initial program 99.3%

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

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

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

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

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

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

    if -1.44999999999999995e-30 < y < 9.4999999999999991e-56

    1. Initial program 89.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 80.4%

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

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

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

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

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

Alternative 9: 42.4% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.05 \cdot 10^{-9} \lor \neg \left(b \leq 6.8 \cdot 10^{-10}\right):\\
\;\;\;\;e^{a \cdot \left(-b\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.0500000000000001e-9 or 6.8000000000000003e-10 < b

    1. Initial program 98.6%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-exp-log71.4%

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

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

        \[\leadsto e^{\color{blue}{\log \left(e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\right) + \log x}} \]
    4. Applied egg-rr42.3%

      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(z\right) - b\right)\right) + \log x}} \]
    5. Taylor expanded in b around inf 46.6%

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

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

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

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

    if -1.0500000000000001e-9 < b < 6.8000000000000003e-10

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 29.9% accurate, 11.6× speedup?

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

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

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

\mathbf{elif}\;y \leq -7 \cdot 10^{-119}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.69999999999999987e199 or -1.25e7 < y < -7e-119

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.69999999999999987e199 < y < -1.25e7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7e-119 < y < 5.49999999999999977e-21

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

    if 5.49999999999999977e-21 < 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 66.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 23.8% accurate, 12.1× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.2 \cdot 10^{-170}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 5.5 \cdot 10^{-18}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\

\mathbf{elif}\;a \leq 3.5 \cdot 10^{+89}:\\
\;\;\;\;t \cdot \frac{x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -4.2000000000000002e61 or 3.5000000000000001e89 < a

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2000000000000002e61 < a < 1.2e-170

    1. Initial program 99.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 49.9%

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

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

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

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

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

    if 1.2e-170 < a < 5.5e-18

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.5e-18 < a < 3.5000000000000001e89

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.2 \cdot 10^{+61}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{-170}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{-18}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{+89}:\\ \;\;\;\;t \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 23.6% accurate, 15.0× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{if}\;a \leq -4.4 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.08 \cdot 10^{-169}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.7 \cdot 10^{+148}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.4000000000000001e61 or 1.7000000000000001e148 < a

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4000000000000001e61 < a < 1.0799999999999999e-169

    1. Initial program 99.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 49.9%

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

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

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

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

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

    if 1.0799999999999999e-169 < a < 1.7000000000000001e148

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.4 \cdot 10^{+61}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;a \leq 1.08 \cdot 10^{-169}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{+148}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 23.8% accurate, 15.0× speedup?

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

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

\mathbf{elif}\;a \leq 8 \cdot 10^{-169}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.56 \cdot 10^{+147}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -4.7999999999999998e61

    1. Initial program 87.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 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.7999999999999998e61 < a < 8.00000000000000016e-169

    1. Initial program 99.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 49.9%

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

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

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

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

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

    if 8.00000000000000016e-169 < a < 1.56e147

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.56e147 < a

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.8 \cdot 10^{+61}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;a \leq 8 \cdot 10^{-169}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.56 \cdot 10^{+147}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 24.2% accurate, 15.0× speedup?

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

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

\mathbf{elif}\;a \leq 7.2 \cdot 10^{-169}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 8.5 \cdot 10^{+149}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -3.19999999999999984e62

    1. Initial program 87.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 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.19999999999999984e62 < a < 7.20000000000000003e-169

    1. Initial program 99.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 49.9%

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

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

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

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

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

    if 7.20000000000000003e-169 < a < 8.49999999999999956e149

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.49999999999999956e149 < a

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.2 \cdot 10^{+62}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;a \leq 7.2 \cdot 10^{-169}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{+149}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 32.2% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+35} \lor \neg \left(t \leq 1.12 \cdot 10^{+104}\right):\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.19999999999999983e35 or 1.12000000000000003e104 < t

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.19999999999999983e35 < t < 1.12000000000000003e104

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

Alternative 16: 30.8% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.05 \cdot 10^{-21}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\

\mathbf{elif}\;a \leq 1.55 \cdot 10^{+147}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.05000000000000007e-21

    1. Initial program 91.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 69.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \left(\frac{x}{b} - a \cdot x\right)} \]
    10. Step-by-step derivation
      1. *-commutative31.6%

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

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

    if -3.05000000000000007e-21 < a < 1.55e147

    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 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)}} \]
    6. Taylor expanded in y around 0 35.7%

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

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

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

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

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

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

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

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

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

    if 1.55e147 < a

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 26.6% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+62} \lor \neg \left(a \leq 8.5 \cdot 10^{+88}\right):\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t \cdot \frac{x}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.40000000000000007e62 or 8.5000000000000005e88 < a

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.40000000000000007e62 < a < 8.5000000000000005e88

    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 t around inf 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t \cdot \color{blue}{\frac{x}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification29.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.4 \cdot 10^{+62} \lor \neg \left(a \leq 8.5 \cdot 10^{+88}\right):\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{x}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 24.7% accurate, 20.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.2e11 or 3900 < y

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

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

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

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

      \[\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)} \]
      3. *-commutative11.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\left(\left(-a\right) \cdot x\right) \cdot b\right)}}^{1} \]
      3. *-commutative21.9%

        \[\leadsto {\left(\color{blue}{\left(x \cdot \left(-a\right)\right)} \cdot b\right)}^{1} \]
      4. associate-*l*22.3%

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

        \[\leadsto {\left(x \cdot \left(\color{blue}{\left(\sqrt{-a} \cdot \sqrt{-a}\right)} \cdot b\right)\right)}^{1} \]
      6. sqrt-unprod29.9%

        \[\leadsto {\left(x \cdot \left(\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}} \cdot b\right)\right)}^{1} \]
      7. sqr-neg29.9%

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

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

        \[\leadsto {\left(x \cdot \left(\color{blue}{a} \cdot b\right)\right)}^{1} \]
    13. Applied egg-rr15.4%

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(x \cdot b\right)} \]
    15. Simplified16.8%

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

    if -4.2e11 < y < 3900

    1. Initial program 91.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 76.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -420000000000 \lor \neg \left(y \leq 3900\right):\\ \;\;\;\;a \cdot \left(x \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 24.8% accurate, 63.0× speedup?

\[\begin{array}{l} \\ t \cdot \frac{x}{t} \end{array} \]
(FPCore (x y z t a b) :precision binary64 (* t (/ x t)))
double code(double x, double y, double z, double t, double a, double b) {
	return t * (x / t);
}
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 = t * (x / t)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return t * (x / t);
}
def code(x, y, z, t, a, b):
	return t * (x / t)
function code(x, y, z, t, a, b)
	return Float64(t * Float64(x / t))
end
function tmp = code(x, y, z, t, a, b)
	tmp = t * (x / t);
end
code[x_, y_, z_, t_, a_, b_] := N[(t * N[(x / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
t \cdot \frac{x}{t}
\end{array}
Derivation
  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 t around inf 60.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto t \cdot \color{blue}{\frac{x}{t}} \]
  13. Final simplification23.3%

    \[\leadsto t \cdot \frac{x}{t} \]
  14. Add Preprocessing

Alternative 20: 19.1% accurate, 315.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 95.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 54.8%

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

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

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

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

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

    \[\leadsto x \]
  8. Add Preprocessing

Reproduce

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