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

Percentage Accurate: 96.5% → 99.4%
Time: 21.4s
Alternatives: 18
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 96.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% 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-define96.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-neg96.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-define98.8%

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

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

    \[\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.5% accurate, 1.0× speedup?

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

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
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: 87.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{if}\;t \leq -7 \cdot 10^{+183}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1 \cdot 10^{+109}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\ \mathbf{elif}\;t \leq -7400000000000 \lor \neg \left(t \leq 2.15 \cdot 10^{+176}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (exp (* y (- t))))))
   (if (<= t -7e+183)
     t_1
     (if (<= t -1e+109)
       (* x (exp (* a (- (- b) z))))
       (if (or (<= t -7400000000000.0) (not (<= t 2.15e+176)))
         t_1
         (* x (exp (- (* y (log z)) (* a b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * exp((y * -t));
	double tmp;
	if (t <= -7e+183) {
		tmp = t_1;
	} else if (t <= -1e+109) {
		tmp = x * exp((a * (-b - z)));
	} else if ((t <= -7400000000000.0) || !(t <= 2.15e+176)) {
		tmp = t_1;
	} else {
		tmp = x * exp(((y * log(z)) - (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) :: t_1
    real(8) :: tmp
    t_1 = x * exp((y * -t))
    if (t <= (-7d+183)) then
        tmp = t_1
    else if (t <= (-1d+109)) then
        tmp = x * exp((a * (-b - z)))
    else if ((t <= (-7400000000000.0d0)) .or. (.not. (t <= 2.15d+176))) then
        tmp = t_1
    else
        tmp = x * exp(((y * log(z)) - (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 t_1 = x * Math.exp((y * -t));
	double tmp;
	if (t <= -7e+183) {
		tmp = t_1;
	} else if (t <= -1e+109) {
		tmp = x * Math.exp((a * (-b - z)));
	} else if ((t <= -7400000000000.0) || !(t <= 2.15e+176)) {
		tmp = t_1;
	} else {
		tmp = x * Math.exp(((y * Math.log(z)) - (a * b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.exp((y * -t))
	tmp = 0
	if t <= -7e+183:
		tmp = t_1
	elif t <= -1e+109:
		tmp = x * math.exp((a * (-b - z)))
	elif (t <= -7400000000000.0) or not (t <= 2.15e+176):
		tmp = t_1
	else:
		tmp = x * math.exp(((y * math.log(z)) - (a * b)))
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * exp(Float64(y * Float64(-t))))
	tmp = 0.0
	if (t <= -7e+183)
		tmp = t_1;
	elseif (t <= -1e+109)
		tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z))));
	elseif ((t <= -7400000000000.0) || !(t <= 2.15e+176))
		tmp = t_1;
	else
		tmp = Float64(x * exp(Float64(Float64(y * log(z)) - Float64(a * b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * exp((y * -t));
	tmp = 0.0;
	if (t <= -7e+183)
		tmp = t_1;
	elseif (t <= -1e+109)
		tmp = x * exp((a * (-b - z)));
	elseif ((t <= -7400000000000.0) || ~((t <= 2.15e+176)))
		tmp = t_1;
	else
		tmp = x * exp(((y * log(z)) - (a * b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7e+183], t$95$1, If[LessEqual[t, -1e+109], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -7400000000000.0], N[Not[LessEqual[t, 2.15e+176]], $MachinePrecision]], t$95$1, N[(x * N[Exp[N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t \leq -7400000000000 \lor \neg \left(t \leq 2.15 \cdot 10^{+176}\right):\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.99999999999999974e183 or -9.99999999999999982e108 < t < -7.4e12 or 2.15000000000000013e176 < t

    1. Initial program 94.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 89.8%

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

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

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

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

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

    if -6.99999999999999974e183 < t < -9.99999999999999982e108

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -7.4e12 < t < 2.15000000000000013e176

    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 z around 0 96.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \log z - a \cdot b}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+183}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq -1 \cdot 10^{+109}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\ \mathbf{elif}\;t \leq -7400000000000 \lor \neg \left(t \leq 2.15 \cdot 10^{+176}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 86.4% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.46 \lor \neg \left(y \leq 2.95 \cdot 10^{-83}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.46000000000000002 or 2.9499999999999998e-83 < y

    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 a around 0 87.9%

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

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

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

        \[\leadsto x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y} \]
      4. rem-exp-log86.5%

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

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

    if -0.46000000000000002 < y < 2.9499999999999998e-83

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 96.0% 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 95.7%

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

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

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

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

      \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \color{blue}{\left(-\log \left(\frac{1}{z}\right)\right)} - t, -1 \cdot \left(a \cdot b\right)\right)} \]
    4. log-rec95.8%

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

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

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

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

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

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

Alternative 6: 72.2% accurate, 2.5× speedup?

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

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

\mathbf{elif}\;t \leq -2.9 \cdot 10^{-260}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 6.8 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.99999999999999974e183 or 6.8000000000000005e-35 < t

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

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

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

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

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

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

    if -6.99999999999999974e183 < t < -2.8999999999999999e-260 or 8.80000000000000039e-213 < t < 6.8000000000000005e-35

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

    if -2.8999999999999999e-260 < t < 8.80000000000000039e-213

    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 a around 0 87.0%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}} \]
      2. exp-prod87.0%

        \[\leadsto x \cdot \color{blue}{{\left(e^{\log z - t}\right)}^{y}} \]
      3. exp-diff87.0%

        \[\leadsto x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y} \]
      4. rem-exp-log87.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+183}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq -2.9 \cdot 10^{-260}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\ \mathbf{elif}\;t \leq 8.8 \cdot 10^{-213}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{-35}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 73.0% accurate, 2.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.19999999999999996 or 0.0369999999999999982 < y

    1. Initial program 97.4%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}} \]
      2. exp-prod90.6%

        \[\leadsto x \cdot \color{blue}{{\left(e^{\log z - t}\right)}^{y}} \]
      3. exp-diff90.6%

        \[\leadsto x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y} \]
      4. rem-exp-log90.6%

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

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

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

    if -1.19999999999999996 < y < 1.06e-88

    1. Initial program 96.6%

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

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

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

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

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

    if 1.06e-88 < y < 0.0369999999999999982

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

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

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

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

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

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

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

Alternative 8: 73.4% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6.5 \lor \neg \left(y \leq 1.8\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 -6.5) (not (<= y 1.8)))
   (* 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 <= -6.5) || !(y <= 1.8)) {
		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 <= (-6.5d0)) .or. (.not. (y <= 1.8d0))) 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 <= -6.5) || !(y <= 1.8)) {
		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 <= -6.5) or not (y <= 1.8):
		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 <= -6.5) || !(y <= 1.8))
		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 <= -6.5) || ~((y <= 1.8)))
		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, -6.5], N[Not[LessEqual[y, 1.8]], $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 -6.5 \lor \neg \left(y \leq 1.8\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 < -6.5 or 1.80000000000000004 < y

    1. Initial program 97.4%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}} \]
      2. exp-prod90.6%

        \[\leadsto x \cdot \color{blue}{{\left(e^{\log z - t}\right)}^{y}} \]
      3. exp-diff90.6%

        \[\leadsto x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y} \]
      4. rem-exp-log90.6%

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

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

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

    if -6.5 < y < 1.80000000000000004

    1. Initial program 95.8%

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

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

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

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

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

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

Alternative 9: 53.4% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+45}:\\
\;\;\;\;b \cdot \left(a \cdot \left(\frac{x}{a \cdot b} - x\right)\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e45 < t

    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 a around 0 73.2%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}} \]
      2. exp-prod67.0%

        \[\leadsto x \cdot \color{blue}{{\left(e^{\log z - t}\right)}^{y}} \]
      3. exp-diff67.0%

        \[\leadsto x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y} \]
      4. rem-exp-log67.0%

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

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

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

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

Alternative 10: 28.7% accurate, 15.0× speedup?

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

\\
\begin{array}{l}
t_1 := b \cdot \frac{x}{b}\\
\mathbf{if}\;y \leq -0.24:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.1 \cdot 10^{-210}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -0.23999999999999999 or 1.09999999999999995e-210 < y < 3.9999999999999998e-7

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.23999999999999999 < y < 1.09999999999999995e-210

    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 a around 0 54.8%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}} \]
      2. exp-prod44.3%

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

        \[\leadsto x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y} \]
      4. rem-exp-log44.3%

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

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

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

    if 3.9999999999999998e-7 < y

    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 y around 0 36.3%

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

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

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

      \[\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 x \cdot \color{blue}{{\left(1 - z\right)}^{a}} \]
    7. Taylor expanded in z around 0 3.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.24:\\ \;\;\;\;b \cdot \frac{x}{b}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-210}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-7}:\\ \;\;\;\;b \cdot \frac{x}{b}\\ \mathbf{else}:\\ \;\;\;\;-z \cdot \left(x \cdot a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 33.4% accurate, 18.5× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.26000000000000001 < y < 8.2000000000000001e-17

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.2000000000000001e-17 < y

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 35.3% accurate, 18.5× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.149999999999999994 < y < 7.1999999999999999e-17

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.1999999999999999e-17 < y

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 28.0% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7800000000000 \lor \neg \left(y \leq 2.6 \cdot 10^{-20}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.8e12 or 2.59999999999999995e-20 < y

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.8e12 < y < 2.59999999999999995e-20

    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 a around 0 61.4%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}} \]
      2. exp-prod51.8%

        \[\leadsto x \cdot \color{blue}{{\left(e^{\log z - t}\right)}^{y}} \]
      3. exp-diff51.8%

        \[\leadsto x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y} \]
      4. rem-exp-log51.8%

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

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

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

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

Alternative 14: 27.9% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6600000000000 \lor \neg \left(y \leq 4.2 \cdot 10^{-24}\right):\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.6e12 or 4.1999999999999999e-24 < y

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.6e12 < y < 4.1999999999999999e-24

    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 a around 0 61.4%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}} \]
      2. exp-prod51.8%

        \[\leadsto x \cdot \color{blue}{{\left(e^{\log z - t}\right)}^{y}} \]
      3. exp-diff51.8%

        \[\leadsto x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y} \]
      4. rem-exp-log51.8%

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

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

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

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

Alternative 15: 25.1% accurate, 20.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.2 \cdot 10^{-274} \lor \neg \left(b \leq 8.2 \cdot 10^{-267}\right):\\
\;\;\;\;b \cdot \frac{x}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.2e-274 or 8.20000000000000022e-267 < b

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2e-274 < b < 8.20000000000000022e-267

    1. Initial program 89.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 a around 0 86.1%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}} \]
      2. exp-prod72.7%

        \[\leadsto x \cdot \color{blue}{{\left(e^{\log z - t}\right)}^{y}} \]
      3. exp-diff72.7%

        \[\leadsto x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y} \]
      4. rem-exp-log72.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.2 \cdot 10^{-274} \lor \neg \left(b \leq 8.2 \cdot 10^{-267}\right):\\ \;\;\;\;b \cdot \frac{x}{b}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 31.6% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.00000000000000012e-17 < y

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 23.5% accurate, 31.5× speedup?

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

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

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


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

    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 a around 0 68.9%

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

        \[\leadsto x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}} \]
      2. exp-prod62.0%

        \[\leadsto x \cdot \color{blue}{{\left(e^{\log z - t}\right)}^{y}} \]
      3. exp-diff62.0%

        \[\leadsto x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y} \]
      4. rem-exp-log62.0%

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

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

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

    if 8.2000000000000001e-17 < y

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)} \cdot \left(b \cdot x\right) \]
      5. add-sqr-sqrt22.4%

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

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

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

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

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

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

Alternative 18: 19.6% 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 a around 0 73.8%

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

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

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

      \[\leadsto x \cdot {\color{blue}{\left(\frac{e^{\log z}}{e^{t}}\right)}}^{y} \]
    4. rem-exp-log68.5%

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

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

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

    \[\leadsto x \]
  8. Add Preprocessing

Reproduce

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