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

Percentage Accurate: 96.5% → 99.5%
Time: 26.3s
Alternatives: 21
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 21 alternatives:

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

Initial Program: 96.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.8× speedup?

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

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

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Step-by-step derivation
    1. fma-def98.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-neg98.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-def100.0%

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

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

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

Alternative 2: 96.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 3: 91.1% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.1e-4 or 1.70000000000000003e37 < y

    1. Initial program 98.3%

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

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

    if -9.1e-4 < y < 1.70000000000000003e37

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 95.9% 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 97.7%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Step-by-step derivation
    1. fma-def98.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-neg98.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-def100.0%

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

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

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

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

Alternative 5: 77.0% accurate, 2.8× speedup?

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

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

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-6} \lor \neg \left(y \leq 1.25 \cdot 10^{+56}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

    if -6.50000000000000005e217 < y < -1.9e-6 or 1.25000000000000006e56 < y

    1. Initial program 99.0%

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

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

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

    if -1.9e-6 < y < 1.25000000000000006e56

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{+217}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-6} \lor \neg \left(y \leq 1.25 \cdot 10^{+56}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \end{array} \]

Alternative 6: 83.1% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{-6} \lor \neg \left(t \leq 6.2 \cdot 10^{-142}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right) - y \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.65000000000000008e-6 or 6.2e-142 < 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. Step-by-step derivation
      1. fma-def97.7%

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

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

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

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

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

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

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

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

    if -1.65000000000000008e-6 < t < 6.2e-142

    1. Initial program 100.0%

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

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

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

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

Alternative 7: 74.0% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+218}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-6} \lor \neg \left(y \leq 5.3 \cdot 10^{+35}\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 (<= y -1e+218)
   (* x (exp (* y (- t))))
   (if (or (<= y -1.9e-6) (not (<= y 5.3e+35)))
     (* 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 <= -1e+218) {
		tmp = x * exp((y * -t));
	} else if ((y <= -1.9e-6) || !(y <= 5.3e+35)) {
		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 <= (-1d+218)) then
        tmp = x * exp((y * -t))
    else if ((y <= (-1.9d-6)) .or. (.not. (y <= 5.3d+35))) 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 <= -1e+218) {
		tmp = x * Math.exp((y * -t));
	} else if ((y <= -1.9e-6) || !(y <= 5.3e+35)) {
		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 <= -1e+218:
		tmp = x * math.exp((y * -t))
	elif (y <= -1.9e-6) or not (y <= 5.3e+35):
		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 <= -1e+218)
		tmp = Float64(x * exp(Float64(y * Float64(-t))));
	elseif ((y <= -1.9e-6) || !(y <= 5.3e+35))
		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 <= -1e+218)
		tmp = x * exp((y * -t));
	elseif ((y <= -1.9e-6) || ~((y <= 5.3e+35)))
		tmp = x * (z ^ y);
	else
		tmp = x * exp((a * -b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1e+218], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.9e-6], N[Not[LessEqual[y, 5.3e+35]], $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 -1 \cdot 10^{+218}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-6} \lor \neg \left(y \leq 5.3 \cdot 10^{+35}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

    if -1.00000000000000008e218 < y < -1.9e-6 or 5.30000000000000009e35 < y

    1. Initial program 98.0%

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

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

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

    if -1.9e-6 < y < 5.30000000000000009e35

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+218}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-6} \lor \neg \left(y \leq 5.3 \cdot 10^{+35}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \]

Alternative 8: 59.4% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-13} \lor \neg \left(y \leq 6.5 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.70000000000000008e-13 or 6.5000000000000003e-9 < y

    1. Initial program 98.5%

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

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

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

    if -1.70000000000000008e-13 < y < 6.5000000000000003e-9

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{-13} \lor \neg \left(y \leq 6.5 \cdot 10^{-9}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-z\right)}\\ \end{array} \]

Alternative 9: 73.6% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{-6} \lor \neg \left(y \leq 1.62 \cdot 10^{+35}\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 -1.8e-6) (not (<= y 1.62e+35)))
   (* 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 <= -1.8e-6) || !(y <= 1.62e+35)) {
		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 <= (-1.8d-6)) .or. (.not. (y <= 1.62d+35))) 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 <= -1.8e-6) || !(y <= 1.62e+35)) {
		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 <= -1.8e-6) or not (y <= 1.62e+35):
		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 <= -1.8e-6) || !(y <= 1.62e+35))
		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 <= -1.8e-6) || ~((y <= 1.62e+35)))
		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, -1.8e-6], N[Not[LessEqual[y, 1.62e+35]], $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 -1.8 \cdot 10^{-6} \lor \neg \left(y \leq 1.62 \cdot 10^{+35}\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 < -1.79999999999999992e-6 or 1.62e35 < y

    1. Initial program 98.4%

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

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

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

    if -1.79999999999999992e-6 < y < 1.62e35

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

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

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

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

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

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

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

Alternative 10: 54.7% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + \left(1 + -1 \cdot \left(a \cdot \left(z + b\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-+r+30.0%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + 1\right) - a \cdot \left(b + z\right)\right)} \]
      5. fma-def30.0%

        \[\leadsto x \cdot \left(\color{blue}{\mathsf{fma}\left(0.5, {a}^{2} \cdot {\left(z + b\right)}^{2}, 1\right)} - a \cdot \left(b + z\right)\right) \]
      6. +-commutative30.0%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, {a}^{2} \cdot {\color{blue}{\left(b + z\right)}}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
      7. unpow230.0%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot a\right)} \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
    10. Simplified30.0%

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(0.5, \left(a \cdot a\right) \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right)} \]
    11. Taylor expanded in z around inf 39.8%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {z}^{2}\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutative39.8%

        \[\leadsto x \cdot \color{blue}{\left(\left({a}^{2} \cdot {z}^{2}\right) \cdot 0.5\right)} \]
      2. unpow239.8%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(a \cdot a\right)} \cdot {z}^{2}\right) \cdot 0.5\right) \]
      3. unpow239.8%

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

        \[\leadsto x \cdot \left(\color{blue}{\left(\left(a \cdot z\right) \cdot \left(a \cdot z\right)\right)} \cdot 0.5\right) \]
    13. Simplified38.7%

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

    if -450 < t

    1. Initial program 97.4%

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

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

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

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

Alternative 11: 42.3% accurate, 12.5× speedup?

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

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

\mathbf{elif}\;y \leq -1.6 \cdot 10^{+199}:\\
\;\;\;\;x \cdot \left(\left(\left(z \cdot a\right) \cdot \left(z \cdot a\right)\right) \cdot 0.5\right)\\

\mathbf{elif}\;y \leq -1.1 \cdot 10^{+160}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.20000000000000014e265 or -1.60000000000000003e199 < y < -1.09999999999999996e160

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.20000000000000014e265 < y < -1.60000000000000003e199

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + \left(1 + -1 \cdot \left(a \cdot \left(z + b\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-+r+27.7%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + 1\right) - a \cdot \left(b + z\right)\right)} \]
      5. fma-def27.7%

        \[\leadsto x \cdot \left(\color{blue}{\mathsf{fma}\left(0.5, {a}^{2} \cdot {\left(z + b\right)}^{2}, 1\right)} - a \cdot \left(b + z\right)\right) \]
      6. +-commutative27.7%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, {a}^{2} \cdot {\color{blue}{\left(b + z\right)}}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
      7. unpow227.7%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot a\right)} \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
    10. Simplified27.7%

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(0.5, \left(a \cdot a\right) \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right)} \]
    11. Taylor expanded in z around inf 53.3%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {z}^{2}\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutative53.3%

        \[\leadsto x \cdot \color{blue}{\left(\left({a}^{2} \cdot {z}^{2}\right) \cdot 0.5\right)} \]
      2. unpow253.3%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(a \cdot a\right)} \cdot {z}^{2}\right) \cdot 0.5\right) \]
      3. unpow253.3%

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

        \[\leadsto x \cdot \left(\color{blue}{\left(\left(a \cdot z\right) \cdot \left(a \cdot z\right)\right)} \cdot 0.5\right) \]
    13. Simplified48.4%

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

    if -1.09999999999999996e160 < y < 8.1999999999999996e-76

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + \left(1 + -1 \cdot \left(a \cdot \left(z + b\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-+r+46.6%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + 1\right) - a \cdot \left(b + z\right)\right)} \]
      5. fma-def46.6%

        \[\leadsto x \cdot \left(\color{blue}{\mathsf{fma}\left(0.5, {a}^{2} \cdot {\left(z + b\right)}^{2}, 1\right)} - a \cdot \left(b + z\right)\right) \]
      6. +-commutative46.6%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, {a}^{2} \cdot {\color{blue}{\left(b + z\right)}}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
      7. unpow246.6%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot a\right)} \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
    10. Simplified46.6%

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(0.5, \left(a \cdot a\right) \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right)} \]
    11. Taylor expanded in z around 0 45.2%

      \[\leadsto \color{blue}{\left(\left(1 + 0.5 \cdot \left({a}^{2} \cdot {b}^{2}\right)\right) - a \cdot b\right) \cdot x} \]
    12. Step-by-step derivation
      1. associate--l+45.2%

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

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

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

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

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

    if 8.1999999999999996e-76 < y

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + \left(1 + -1 \cdot \left(a \cdot \left(z + b\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-+r+16.3%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + 1\right) - a \cdot \left(b + z\right)\right)} \]
      5. fma-def16.3%

        \[\leadsto x \cdot \left(\color{blue}{\mathsf{fma}\left(0.5, {a}^{2} \cdot {\left(z + b\right)}^{2}, 1\right)} - a \cdot \left(b + z\right)\right) \]
      6. +-commutative16.3%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, {a}^{2} \cdot {\color{blue}{\left(b + z\right)}}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
      7. unpow216.3%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot a\right)} \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
    10. Simplified16.3%

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(0.5, \left(a \cdot a\right) \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right)} \]
    11. Taylor expanded in z around inf 47.4%

      \[\leadsto \color{blue}{0.5 \cdot \left({a}^{2} \cdot \left({z}^{2} \cdot x\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutative47.4%

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

        \[\leadsto \color{blue}{\left(\left({a}^{2} \cdot {z}^{2}\right) \cdot x\right)} \cdot 0.5 \]
      3. associate-*l*48.8%

        \[\leadsto \color{blue}{\left({a}^{2} \cdot {z}^{2}\right) \cdot \left(x \cdot 0.5\right)} \]
      4. unpow248.8%

        \[\leadsto \left(\color{blue}{\left(a \cdot a\right)} \cdot {z}^{2}\right) \cdot \left(x \cdot 0.5\right) \]
      5. unpow248.8%

        \[\leadsto \left(\left(a \cdot a\right) \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot \left(x \cdot 0.5\right) \]
      6. swap-sqr48.0%

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

        \[\leadsto \color{blue}{\left(a \cdot \left(z \cdot \left(a \cdot z\right)\right)\right)} \cdot \left(x \cdot 0.5\right) \]
    13. Simplified49.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+265}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -1.6 \cdot 10^{+199}:\\ \;\;\;\;x \cdot \left(\left(\left(z \cdot a\right) \cdot \left(z \cdot a\right)\right) \cdot 0.5\right)\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+160}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-76}:\\ \;\;\;\;x \cdot \left(1 + \left(0.5 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right) - a \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(z \cdot \left(z \cdot a\right)\right)\right) \cdot \left(x \cdot 0.5\right)\\ \end{array} \]

Alternative 12: 40.4% accurate, 14.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\left(\left(z \cdot a\right) \cdot \left(z \cdot a\right)\right) \cdot 0.5\right)\\ t_2 := t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{if}\;y \leq -2.05 \cdot 10^{+265}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -5 \cdot 10^{+196}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{+160}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-34}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-64}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (* (* (* z a) (* z a)) 0.5))) (t_2 (* t (* x (- y)))))
   (if (<= y -2.05e+265)
     t_2
     (if (<= y -5e+196)
       t_1
       (if (<= y -3.9e+160)
         t_2
         (if (<= y -9.5e-34)
           (* x (* 0.5 (* (* a a) (* b b))))
           (if (<= y 1.12e-64) (* x (- 1.0 (* a (+ z b)))) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * (((z * a) * (z * a)) * 0.5);
	double t_2 = t * (x * -y);
	double tmp;
	if (y <= -2.05e+265) {
		tmp = t_2;
	} else if (y <= -5e+196) {
		tmp = t_1;
	} else if (y <= -3.9e+160) {
		tmp = t_2;
	} else if (y <= -9.5e-34) {
		tmp = x * (0.5 * ((a * a) * (b * b)));
	} else if (y <= 1.12e-64) {
		tmp = x * (1.0 - (a * (z + b)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (((z * a) * (z * a)) * 0.5d0)
    t_2 = t * (x * -y)
    if (y <= (-2.05d+265)) then
        tmp = t_2
    else if (y <= (-5d+196)) then
        tmp = t_1
    else if (y <= (-3.9d+160)) then
        tmp = t_2
    else if (y <= (-9.5d-34)) then
        tmp = x * (0.5d0 * ((a * a) * (b * b)))
    else if (y <= 1.12d-64) then
        tmp = x * (1.0d0 - (a * (z + b)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * (((z * a) * (z * a)) * 0.5);
	double t_2 = t * (x * -y);
	double tmp;
	if (y <= -2.05e+265) {
		tmp = t_2;
	} else if (y <= -5e+196) {
		tmp = t_1;
	} else if (y <= -3.9e+160) {
		tmp = t_2;
	} else if (y <= -9.5e-34) {
		tmp = x * (0.5 * ((a * a) * (b * b)));
	} else if (y <= 1.12e-64) {
		tmp = x * (1.0 - (a * (z + b)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * (((z * a) * (z * a)) * 0.5)
	t_2 = t * (x * -y)
	tmp = 0
	if y <= -2.05e+265:
		tmp = t_2
	elif y <= -5e+196:
		tmp = t_1
	elif y <= -3.9e+160:
		tmp = t_2
	elif y <= -9.5e-34:
		tmp = x * (0.5 * ((a * a) * (b * b)))
	elif y <= 1.12e-64:
		tmp = x * (1.0 - (a * (z + b)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * Float64(Float64(Float64(z * a) * Float64(z * a)) * 0.5))
	t_2 = Float64(t * Float64(x * Float64(-y)))
	tmp = 0.0
	if (y <= -2.05e+265)
		tmp = t_2;
	elseif (y <= -5e+196)
		tmp = t_1;
	elseif (y <= -3.9e+160)
		tmp = t_2;
	elseif (y <= -9.5e-34)
		tmp = Float64(x * Float64(0.5 * Float64(Float64(a * a) * Float64(b * b))));
	elseif (y <= 1.12e-64)
		tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * (((z * a) * (z * a)) * 0.5);
	t_2 = t * (x * -y);
	tmp = 0.0;
	if (y <= -2.05e+265)
		tmp = t_2;
	elseif (y <= -5e+196)
		tmp = t_1;
	elseif (y <= -3.9e+160)
		tmp = t_2;
	elseif (y <= -9.5e-34)
		tmp = x * (0.5 * ((a * a) * (b * b)));
	elseif (y <= 1.12e-64)
		tmp = x * (1.0 - (a * (z + b)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[(N[(z * a), $MachinePrecision] * N[(z * a), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.05e+265], t$95$2, If[LessEqual[y, -5e+196], t$95$1, If[LessEqual[y, -3.9e+160], t$95$2, If[LessEqual[y, -9.5e-34], N[(x * N[(0.5 * N[(N[(a * a), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e-64], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -5 \cdot 10^{+196}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -3.9 \cdot 10^{+160}:\\
\;\;\;\;t_2\\

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.0500000000000002e265 or -4.9999999999999998e196 < y < -3.90000000000000007e160

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0500000000000002e265 < y < -4.9999999999999998e196 or 1.12e-64 < y

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + \left(1 + -1 \cdot \left(a \cdot \left(z + b\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-+r+19.3%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + 1\right) - a \cdot \left(b + z\right)\right)} \]
      5. fma-def19.3%

        \[\leadsto x \cdot \left(\color{blue}{\mathsf{fma}\left(0.5, {a}^{2} \cdot {\left(z + b\right)}^{2}, 1\right)} - a \cdot \left(b + z\right)\right) \]
      6. +-commutative19.3%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, {a}^{2} \cdot {\color{blue}{\left(b + z\right)}}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
      7. unpow219.3%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot a\right)} \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
    10. Simplified19.3%

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(0.5, \left(a \cdot a\right) \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right)} \]
    11. Taylor expanded in z around inf 51.4%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {z}^{2}\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutative51.4%

        \[\leadsto x \cdot \color{blue}{\left(\left({a}^{2} \cdot {z}^{2}\right) \cdot 0.5\right)} \]
      2. unpow251.4%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(a \cdot a\right)} \cdot {z}^{2}\right) \cdot 0.5\right) \]
      3. unpow251.4%

        \[\leadsto x \cdot \left(\left(\left(a \cdot a\right) \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot 0.5\right) \]
      4. swap-sqr49.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(\left(a \cdot z\right) \cdot \left(a \cdot z\right)\right)} \cdot 0.5\right) \]
    13. Simplified49.6%

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

    if -3.90000000000000007e160 < y < -9.49999999999999985e-34

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + \left(1 + -1 \cdot \left(a \cdot \left(z + b\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-+r+35.4%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + 1\right) - a \cdot \left(b + z\right)\right)} \]
      5. fma-def35.4%

        \[\leadsto x \cdot \left(\color{blue}{\mathsf{fma}\left(0.5, {a}^{2} \cdot {\left(z + b\right)}^{2}, 1\right)} - a \cdot \left(b + z\right)\right) \]
      6. +-commutative35.4%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, {a}^{2} \cdot {\color{blue}{\left(b + z\right)}}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
      7. unpow235.4%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot a\right)} \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
    10. Simplified35.4%

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(0.5, \left(a \cdot a\right) \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right)} \]
    11. Taylor expanded in b around inf 36.7%

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

        \[\leadsto x \cdot \color{blue}{\left(\left({a}^{2} \cdot {b}^{2}\right) \cdot 0.5\right)} \]
      2. unpow236.7%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(a \cdot a\right)} \cdot {b}^{2}\right) \cdot 0.5\right) \]
      3. unpow236.7%

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

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

    if -9.49999999999999985e-34 < y < 1.12e-64

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{+265}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -5 \cdot 10^{+196}:\\ \;\;\;\;x \cdot \left(\left(\left(z \cdot a\right) \cdot \left(z \cdot a\right)\right) \cdot 0.5\right)\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{+160}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-34}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-64}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(\left(z \cdot a\right) \cdot \left(z \cdot a\right)\right) \cdot 0.5\right)\\ \end{array} \]

Alternative 13: 41.0% accurate, 14.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{if}\;y \leq -3.4 \cdot 10^{+268}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{+196}:\\ \;\;\;\;x \cdot \left(\left(\left(z \cdot a\right) \cdot \left(z \cdot a\right)\right) \cdot 0.5\right)\\ \mathbf{elif}\;y \leq -2.55 \cdot 10^{+160}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.38 \cdot 10^{-33}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-64}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(z \cdot \left(z \cdot a\right)\right)\right) \cdot \left(x \cdot 0.5\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* t (* x (- y)))))
   (if (<= y -3.4e+268)
     t_1
     (if (<= y -4.2e+196)
       (* x (* (* (* z a) (* z a)) 0.5))
       (if (<= y -2.55e+160)
         t_1
         (if (<= y -1.38e-33)
           (* x (* 0.5 (* (* a a) (* b b))))
           (if (<= y 1.12e-64)
             (* x (- 1.0 (* a (+ z b))))
             (* (* a (* z (* z a))) (* x 0.5)))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = t * (x * -y);
	double tmp;
	if (y <= -3.4e+268) {
		tmp = t_1;
	} else if (y <= -4.2e+196) {
		tmp = x * (((z * a) * (z * a)) * 0.5);
	} else if (y <= -2.55e+160) {
		tmp = t_1;
	} else if (y <= -1.38e-33) {
		tmp = x * (0.5 * ((a * a) * (b * b)));
	} else if (y <= 1.12e-64) {
		tmp = x * (1.0 - (a * (z + b)));
	} else {
		tmp = (a * (z * (z * a))) * (x * 0.5);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (x * -y)
    if (y <= (-3.4d+268)) then
        tmp = t_1
    else if (y <= (-4.2d+196)) then
        tmp = x * (((z * a) * (z * a)) * 0.5d0)
    else if (y <= (-2.55d+160)) then
        tmp = t_1
    else if (y <= (-1.38d-33)) then
        tmp = x * (0.5d0 * ((a * a) * (b * b)))
    else if (y <= 1.12d-64) then
        tmp = x * (1.0d0 - (a * (z + b)))
    else
        tmp = (a * (z * (z * a))) * (x * 0.5d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = t * (x * -y);
	double tmp;
	if (y <= -3.4e+268) {
		tmp = t_1;
	} else if (y <= -4.2e+196) {
		tmp = x * (((z * a) * (z * a)) * 0.5);
	} else if (y <= -2.55e+160) {
		tmp = t_1;
	} else if (y <= -1.38e-33) {
		tmp = x * (0.5 * ((a * a) * (b * b)));
	} else if (y <= 1.12e-64) {
		tmp = x * (1.0 - (a * (z + b)));
	} else {
		tmp = (a * (z * (z * a))) * (x * 0.5);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = t * (x * -y)
	tmp = 0
	if y <= -3.4e+268:
		tmp = t_1
	elif y <= -4.2e+196:
		tmp = x * (((z * a) * (z * a)) * 0.5)
	elif y <= -2.55e+160:
		tmp = t_1
	elif y <= -1.38e-33:
		tmp = x * (0.5 * ((a * a) * (b * b)))
	elif y <= 1.12e-64:
		tmp = x * (1.0 - (a * (z + b)))
	else:
		tmp = (a * (z * (z * a))) * (x * 0.5)
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(t * Float64(x * Float64(-y)))
	tmp = 0.0
	if (y <= -3.4e+268)
		tmp = t_1;
	elseif (y <= -4.2e+196)
		tmp = Float64(x * Float64(Float64(Float64(z * a) * Float64(z * a)) * 0.5));
	elseif (y <= -2.55e+160)
		tmp = t_1;
	elseif (y <= -1.38e-33)
		tmp = Float64(x * Float64(0.5 * Float64(Float64(a * a) * Float64(b * b))));
	elseif (y <= 1.12e-64)
		tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b))));
	else
		tmp = Float64(Float64(a * Float64(z * Float64(z * a))) * Float64(x * 0.5));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = t * (x * -y);
	tmp = 0.0;
	if (y <= -3.4e+268)
		tmp = t_1;
	elseif (y <= -4.2e+196)
		tmp = x * (((z * a) * (z * a)) * 0.5);
	elseif (y <= -2.55e+160)
		tmp = t_1;
	elseif (y <= -1.38e-33)
		tmp = x * (0.5 * ((a * a) * (b * b)));
	elseif (y <= 1.12e-64)
		tmp = x * (1.0 - (a * (z + b)));
	else
		tmp = (a * (z * (z * a))) * (x * 0.5);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.4e+268], t$95$1, If[LessEqual[y, -4.2e+196], N[(x * N[(N[(N[(z * a), $MachinePrecision] * N[(z * a), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.55e+160], t$95$1, If[LessEqual[y, -1.38e-33], N[(x * N[(0.5 * N[(N[(a * a), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e-64], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(z * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -4.2 \cdot 10^{+196}:\\
\;\;\;\;x \cdot \left(\left(\left(z \cdot a\right) \cdot \left(z \cdot a\right)\right) \cdot 0.5\right)\\

\mathbf{elif}\;y \leq -2.55 \cdot 10^{+160}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.38 \cdot 10^{-33}:\\
\;\;\;\;x \cdot \left(0.5 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -3.4000000000000003e268 or -4.20000000000000029e196 < y < -2.5500000000000001e160

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4000000000000003e268 < y < -4.20000000000000029e196

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + \left(1 + -1 \cdot \left(a \cdot \left(z + b\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-+r+27.7%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + 1\right) - a \cdot \left(b + z\right)\right)} \]
      5. fma-def27.7%

        \[\leadsto x \cdot \left(\color{blue}{\mathsf{fma}\left(0.5, {a}^{2} \cdot {\left(z + b\right)}^{2}, 1\right)} - a \cdot \left(b + z\right)\right) \]
      6. +-commutative27.7%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, {a}^{2} \cdot {\color{blue}{\left(b + z\right)}}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
      7. unpow227.7%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot a\right)} \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
    10. Simplified27.7%

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(0.5, \left(a \cdot a\right) \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right)} \]
    11. Taylor expanded in z around inf 53.3%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {z}^{2}\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutative53.3%

        \[\leadsto x \cdot \color{blue}{\left(\left({a}^{2} \cdot {z}^{2}\right) \cdot 0.5\right)} \]
      2. unpow253.3%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(a \cdot a\right)} \cdot {z}^{2}\right) \cdot 0.5\right) \]
      3. unpow253.3%

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

        \[\leadsto x \cdot \left(\color{blue}{\left(\left(a \cdot z\right) \cdot \left(a \cdot z\right)\right)} \cdot 0.5\right) \]
    13. Simplified48.4%

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

    if -2.5500000000000001e160 < y < -1.38e-33

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + \left(1 + -1 \cdot \left(a \cdot \left(z + b\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-+r+35.4%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + 1\right) - a \cdot \left(b + z\right)\right)} \]
      5. fma-def35.4%

        \[\leadsto x \cdot \left(\color{blue}{\mathsf{fma}\left(0.5, {a}^{2} \cdot {\left(z + b\right)}^{2}, 1\right)} - a \cdot \left(b + z\right)\right) \]
      6. +-commutative35.4%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, {a}^{2} \cdot {\color{blue}{\left(b + z\right)}}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
      7. unpow235.4%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot a\right)} \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
    10. Simplified35.4%

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(0.5, \left(a \cdot a\right) \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right)} \]
    11. Taylor expanded in b around inf 36.7%

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

        \[\leadsto x \cdot \color{blue}{\left(\left({a}^{2} \cdot {b}^{2}\right) \cdot 0.5\right)} \]
      2. unpow236.7%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(a \cdot a\right)} \cdot {b}^{2}\right) \cdot 0.5\right) \]
      3. unpow236.7%

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

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

    if -1.38e-33 < y < 1.12e-64

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.12e-64 < y

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + \left(1 + -1 \cdot \left(a \cdot \left(z + b\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-+r+16.9%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + 1\right) - a \cdot \left(b + z\right)\right)} \]
      5. fma-def16.9%

        \[\leadsto x \cdot \left(\color{blue}{\mathsf{fma}\left(0.5, {a}^{2} \cdot {\left(z + b\right)}^{2}, 1\right)} - a \cdot \left(b + z\right)\right) \]
      6. +-commutative16.9%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, {a}^{2} \cdot {\color{blue}{\left(b + z\right)}}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
      7. unpow216.9%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot a\right)} \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
    10. Simplified16.9%

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(0.5, \left(a \cdot a\right) \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right)} \]
    11. Taylor expanded in z around inf 49.4%

      \[\leadsto \color{blue}{0.5 \cdot \left({a}^{2} \cdot \left({z}^{2} \cdot x\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutative49.4%

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

        \[\leadsto \color{blue}{\left(\left({a}^{2} \cdot {z}^{2}\right) \cdot x\right)} \cdot 0.5 \]
      3. associate-*l*50.9%

        \[\leadsto \color{blue}{\left({a}^{2} \cdot {z}^{2}\right) \cdot \left(x \cdot 0.5\right)} \]
      4. unpow250.9%

        \[\leadsto \left(\color{blue}{\left(a \cdot a\right)} \cdot {z}^{2}\right) \cdot \left(x \cdot 0.5\right) \]
      5. unpow250.9%

        \[\leadsto \left(\left(a \cdot a\right) \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot \left(x \cdot 0.5\right) \]
      6. swap-sqr49.9%

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

        \[\leadsto \color{blue}{\left(a \cdot \left(z \cdot \left(a \cdot z\right)\right)\right)} \cdot \left(x \cdot 0.5\right) \]
    13. Simplified51.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+268}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{+196}:\\ \;\;\;\;x \cdot \left(\left(\left(z \cdot a\right) \cdot \left(z \cdot a\right)\right) \cdot 0.5\right)\\ \mathbf{elif}\;y \leq -2.55 \cdot 10^{+160}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -1.38 \cdot 10^{-33}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{-64}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(z \cdot \left(z \cdot a\right)\right)\right) \cdot \left(x \cdot 0.5\right)\\ \end{array} \]

Alternative 14: 41.0% accurate, 18.3× speedup?

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

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

\mathbf{elif}\;y \leq -1.38 \cdot 10^{-33} \lor \neg \left(y \leq 0.0058\right):\\
\;\;\;\;x \cdot \left(0.5 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)\right)\\

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


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

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.70000000000000001e159 < y < -1.38e-33 or 0.0058 < y

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {\left(z + b\right)}^{2}\right) + \left(1 + -1 \cdot \left(a \cdot \left(z + b\right)\right)\right)\right)} \]
    9. Step-by-step derivation
      1. associate-+r+25.5%

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

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

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

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

        \[\leadsto x \cdot \left(\color{blue}{\mathsf{fma}\left(0.5, {a}^{2} \cdot {\left(z + b\right)}^{2}, 1\right)} - a \cdot \left(b + z\right)\right) \]
      6. +-commutative25.5%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, {a}^{2} \cdot {\color{blue}{\left(b + z\right)}}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
      7. unpow225.5%

        \[\leadsto x \cdot \left(\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot a\right)} \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right) \]
    10. Simplified25.5%

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(0.5, \left(a \cdot a\right) \cdot {\left(b + z\right)}^{2}, 1\right) - a \cdot \left(b + z\right)\right)} \]
    11. Taylor expanded in b around inf 40.6%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutative40.6%

        \[\leadsto x \cdot \color{blue}{\left(\left({a}^{2} \cdot {b}^{2}\right) \cdot 0.5\right)} \]
      2. unpow240.6%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(a \cdot a\right)} \cdot {b}^{2}\right) \cdot 0.5\right) \]
      3. unpow240.6%

        \[\leadsto x \cdot \left(\left(\left(a \cdot a\right) \cdot \color{blue}{\left(b \cdot b\right)}\right) \cdot 0.5\right) \]
    13. Simplified40.6%

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

    if -1.38e-33 < y < 0.0058

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+159}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -1.38 \cdot 10^{-33} \lor \neg \left(y \leq 0.0058\right):\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(\left(a \cdot a\right) \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \end{array} \]

Alternative 15: 32.8% accurate, 28.3× speedup?

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

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

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

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


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

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.29999999999999996e108 < y < 6.6000000000000003e35

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

    if 6.6000000000000003e35 < y

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.3 \cdot 10^{+108}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \]

Alternative 16: 27.4% accurate, 31.1× speedup?

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

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

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+51}:\\
\;\;\;\;x\\

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


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

    1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.70000000000000009e-37 < y < 1.25e51

    1. Initial program 96.0%

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

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

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

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

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

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

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

    if 1.25e51 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{-37}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+51}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\ \end{array} \]

Alternative 17: 27.8% accurate, 31.1× speedup?

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

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

\mathbf{elif}\;y \leq 2.55 \cdot 10^{-77}:\\
\;\;\;\;x\\

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


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

    1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3e-37 < y < 2.55000000000000016e-77

    1. Initial program 96.1%

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

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

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

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

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

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

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

    if 2.55000000000000016e-77 < y

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{-37}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 2.55 \cdot 10^{-77}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(-x \cdot b\right)\\ \end{array} \]

Alternative 18: 27.1% accurate, 34.5× speedup?

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

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

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

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


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

    1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3e-37 < y < 0.34999999999999998

    1. Initial program 96.6%

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

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

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

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

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

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

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

    if 0.34999999999999998 < y

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot \left(a \cdot b\right)}\right) \]
      3. distribute-rgt-in6.6%

        \[\leadsto \color{blue}{1 \cdot x + \left(-1 \cdot \left(a \cdot b\right)\right) \cdot x} \]
      4. *-un-lft-identity6.6%

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

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

        \[\leadsto x + \color{blue}{\sqrt{\left(-1 \cdot \left(a \cdot b\right)\right) \cdot \left(-1 \cdot \left(a \cdot b\right)\right)}} \cdot x \]
      7. mul-1-neg12.0%

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

        \[\leadsto x + \sqrt{\left(-a \cdot b\right) \cdot \color{blue}{\left(-a \cdot b\right)}} \cdot x \]
      9. sqr-neg12.0%

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

        \[\leadsto x + \color{blue}{\left(\sqrt{a \cdot b} \cdot \sqrt{a \cdot b}\right)} \cdot x \]
      11. add-sqr-sqrt4.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{-37}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 0.35:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot b\right)\\ \end{array} \]

Alternative 19: 30.1% accurate, 34.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.79999999999999989e93

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

    if -2.79999999999999989e93 < b

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 23.1% accurate, 44.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0102:\\
\;\;\;\;x\\

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


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

    1. Initial program 97.5%

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

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

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

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

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

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

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

    if 0.010200000000000001 < y

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{-1 \cdot \left(a \cdot b\right)}\right) \]
      3. distribute-rgt-in6.6%

        \[\leadsto \color{blue}{1 \cdot x + \left(-1 \cdot \left(a \cdot b\right)\right) \cdot x} \]
      4. *-un-lft-identity6.6%

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

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

        \[\leadsto x + \color{blue}{\sqrt{\left(-1 \cdot \left(a \cdot b\right)\right) \cdot \left(-1 \cdot \left(a \cdot b\right)\right)}} \cdot x \]
      7. mul-1-neg12.0%

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

        \[\leadsto x + \sqrt{\left(-a \cdot b\right) \cdot \color{blue}{\left(-a \cdot b\right)}} \cdot x \]
      9. sqr-neg12.0%

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

        \[\leadsto x + \color{blue}{\left(\sqrt{a \cdot b} \cdot \sqrt{a \cdot b}\right)} \cdot x \]
      11. add-sqr-sqrt4.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 0.0102:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot b\right)\\ \end{array} \]

Alternative 21: 19.5% accurate, 315.0× speedup?

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

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

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

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

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

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

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

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

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

    \[\leadsto x \]

Reproduce

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