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

Percentage Accurate: 96.4% → 99.6%
Time: 18.9s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 96.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

Alternative 2: 96.4% accurate, 1.0× speedup?

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

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

    \[\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: 90.2% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8e15 or 5.1999999999999999e98 < y

    1. Initial program 96.0%

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

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

    if -8e15 < y < 5.1999999999999999e98

    1. Initial program 96.9%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot e^{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(t \cdot y\right)}} \]
    8. Step-by-step derivation
      1. *-commutative94.2%

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

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

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

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

Alternative 4: 95.8% accurate, 1.5× speedup?

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

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

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

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

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

Alternative 5: 72.5% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -6 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 2.5 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6e15 or 5.4999999999999998e47 < y < 2.4999999999999998e130

    1. Initial program 92.7%

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

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

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

    if -6e15 < y < 5.4999999999999998e47

    1. Initial program 98.0%

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

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

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

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

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

    if 2.4999999999999998e130 < 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 76.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+15}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+47}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+130}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 75.5% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 4 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.95e19 or 1.04999999999999999e75 < y < 4.0000000000000002e130

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

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

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

    if -1.95e19 < y < 1.04999999999999999e75

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.0000000000000002e130 < 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 76.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{+19}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+75}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+130}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 72.9% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{+17} \lor \neg \left(y \leq 6.8 \cdot 10^{+47}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.75e17 or 6.7999999999999996e47 < y

    1. Initial program 94.6%

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

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

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

    if -2.75e17 < y < 6.7999999999999996e47

    1. Initial program 98.0%

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

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

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

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

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

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

Alternative 8: 83.7% accurate, 2.9× speedup?

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x \cdot e^{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(t \cdot y\right)}} \]
  8. Step-by-step derivation
    1. *-commutative84.2%

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

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

    \[\leadsto \color{blue}{e^{-1 \cdot \left(a \cdot b + t \cdot y\right)} \cdot x} \]
  10. Final simplification84.2%

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

Alternative 9: 55.0% accurate, 2.9× speedup?

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

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

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


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

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - y \cdot t\right)} \]
    10. Applied egg-rr37.1%

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

    if -0.101999999999999993 < t

    1. Initial program 96.4%

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

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

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

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

Alternative 10: 28.2% accurate, 12.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(x \cdot \left(-z\right)\right)\\ t_2 := t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{if}\;y \leq -5.2 \cdot 10^{+106}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-37}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{+155}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* x (- z)))) (t_2 (* t (* x (- y)))))
   (if (<= y -5.2e+106)
     t_2
     (if (<= y -1.1e+24)
       t_1
       (if (<= y 4.5e-37) x (if (<= y 3.05e+155) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (x * -z);
	double t_2 = t * (x * -y);
	double tmp;
	if (y <= -5.2e+106) {
		tmp = t_2;
	} else if (y <= -1.1e+24) {
		tmp = t_1;
	} else if (y <= 4.5e-37) {
		tmp = x;
	} else if (y <= 3.05e+155) {
		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 = a * (x * -z)
    t_2 = t * (x * -y)
    if (y <= (-5.2d+106)) then
        tmp = t_2
    else if (y <= (-1.1d+24)) then
        tmp = t_1
    else if (y <= 4.5d-37) then
        tmp = x
    else if (y <= 3.05d+155) 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 = a * (x * -z);
	double t_2 = t * (x * -y);
	double tmp;
	if (y <= -5.2e+106) {
		tmp = t_2;
	} else if (y <= -1.1e+24) {
		tmp = t_1;
	} else if (y <= 4.5e-37) {
		tmp = x;
	} else if (y <= 3.05e+155) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (x * -z)
	t_2 = t * (x * -y)
	tmp = 0
	if y <= -5.2e+106:
		tmp = t_2
	elif y <= -1.1e+24:
		tmp = t_1
	elif y <= 4.5e-37:
		tmp = x
	elif y <= 3.05e+155:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(x * Float64(-z)))
	t_2 = Float64(t * Float64(x * Float64(-y)))
	tmp = 0.0
	if (y <= -5.2e+106)
		tmp = t_2;
	elseif (y <= -1.1e+24)
		tmp = t_1;
	elseif (y <= 4.5e-37)
		tmp = x;
	elseif (y <= 3.05e+155)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (x * -z);
	t_2 = t * (x * -y);
	tmp = 0.0;
	if (y <= -5.2e+106)
		tmp = t_2;
	elseif (y <= -1.1e+24)
		tmp = t_1;
	elseif (y <= 4.5e-37)
		tmp = x;
	elseif (y <= 3.05e+155)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e+106], t$95$2, If[LessEqual[y, -1.1e+24], t$95$1, If[LessEqual[y, 4.5e-37], x, If[LessEqual[y, 3.05e+155], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.1 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-37}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 3.05 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.20000000000000039e106 or 3.04999999999999978e155 < y

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.20000000000000039e106 < y < -1.10000000000000001e24 or 4.5000000000000004e-37 < y < 3.04999999999999978e155

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \left(-x \cdot z\right)} \]
      3. distribute-lft-neg-in32.8%

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

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

    if -1.10000000000000001e24 < y < 4.5000000000000004e-37

    1. Initial program 97.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{+106}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+24}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-37}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{+155}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 28.6% accurate, 12.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{if}\;y \leq -1.7 \cdot 10^{+105}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -2.25 \cdot 10^{+24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{-45}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{+155}:\\ \;\;\;\;t\_1\\ \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 (* a (* x (- z)))))
   (if (<= y -1.7e+105)
     (* t (* x (- y)))
     (if (<= y -2.25e+24)
       t_1
       (if (<= y 6.6e-45) x (if (<= y 2.6e+155) t_1 (* x (* y (- t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (x * -z);
	double tmp;
	if (y <= -1.7e+105) {
		tmp = t * (x * -y);
	} else if (y <= -2.25e+24) {
		tmp = t_1;
	} else if (y <= 6.6e-45) {
		tmp = x;
	} else if (y <= 2.6e+155) {
		tmp = t_1;
	} 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 = a * (x * -z)
    if (y <= (-1.7d+105)) then
        tmp = t * (x * -y)
    else if (y <= (-2.25d+24)) then
        tmp = t_1
    else if (y <= 6.6d-45) then
        tmp = x
    else if (y <= 2.6d+155) then
        tmp = t_1
    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 = a * (x * -z);
	double tmp;
	if (y <= -1.7e+105) {
		tmp = t * (x * -y);
	} else if (y <= -2.25e+24) {
		tmp = t_1;
	} else if (y <= 6.6e-45) {
		tmp = x;
	} else if (y <= 2.6e+155) {
		tmp = t_1;
	} else {
		tmp = x * (y * -t);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (x * -z)
	tmp = 0
	if y <= -1.7e+105:
		tmp = t * (x * -y)
	elif y <= -2.25e+24:
		tmp = t_1
	elif y <= 6.6e-45:
		tmp = x
	elif y <= 2.6e+155:
		tmp = t_1
	else:
		tmp = x * (y * -t)
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(x * Float64(-z)))
	tmp = 0.0
	if (y <= -1.7e+105)
		tmp = Float64(t * Float64(x * Float64(-y)));
	elseif (y <= -2.25e+24)
		tmp = t_1;
	elseif (y <= 6.6e-45)
		tmp = x;
	elseif (y <= 2.6e+155)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(y * Float64(-t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (x * -z);
	tmp = 0.0;
	if (y <= -1.7e+105)
		tmp = t * (x * -y);
	elseif (y <= -2.25e+24)
		tmp = t_1;
	elseif (y <= 6.6e-45)
		tmp = x;
	elseif (y <= 2.6e+155)
		tmp = t_1;
	else
		tmp = x * (y * -t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e+105], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.25e+24], t$95$1, If[LessEqual[y, 6.6e-45], x, If[LessEqual[y, 2.6e+155], t$95$1, N[(x * N[(y * (-t)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.25 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 6.6 \cdot 10^{-45}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.6 \cdot 10^{+155}:\\
\;\;\;\;t\_1\\

\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 < -1.7e105

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7e105 < y < -2.2500000000000001e24 or 6.6000000000000001e-45 < y < 2.6000000000000002e155

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \left(-x \cdot z\right)} \]
      3. distribute-lft-neg-in32.8%

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

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

    if -2.2500000000000001e24 < y < 6.6000000000000001e-45

    1. Initial program 97.8%

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

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

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

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

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

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

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

    if 2.6000000000000002e155 < 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 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+105}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -2.25 \cdot 10^{+24}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{-45}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{+155}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 28.7% accurate, 15.0× speedup?

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

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

\mathbf{elif}\;y \leq 1.85 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \left(1 - z \cdot a\right)\\

\mathbf{elif}\;y \leq 1.75 \cdot 10^{+155}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\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 < -2.3e107

    1. Initial program 92.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 58.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3e107 < y < 1.85e-37

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.85e-37 < y < 1.74999999999999992e155

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \left(-x \cdot z\right)} \]
      3. distribute-lft-neg-in30.0%

        \[\leadsto a \cdot \color{blue}{\left(\left(-x\right) \cdot z\right)} \]
    12. Simplified30.0%

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

    if 1.74999999999999992e155 < 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 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{+107}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \left(1 - z \cdot a\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+155}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 26.2% accurate, 19.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.7999999999999998e107 or 5.20000000000000013e35 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7999999999999998e107 < y < 5.20000000000000013e35

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

Alternative 14: 23.8% accurate, 26.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 4.30000000000000013e-86

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.30000000000000013e-86 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 24.1% accurate, 26.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 5.5e-86

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.5e-86 < x

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 19.7% accurate, 315.0× speedup?

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

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

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

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

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

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

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

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

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

    \[\leadsto x \]
  8. Add Preprocessing

Reproduce

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