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

Percentage Accurate: 96.6% → 99.6%
Time: 17.6s
Alternatives: 18
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 96.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.8× speedup?

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

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

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

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

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

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

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

Alternative 2: 96.6% accurate, 1.0× speedup?

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

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

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

Alternative 3: 87.4% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-14} \lor \neg \left(y \leq 1.65 \cdot 10^{-26}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.0999999999999999e-14 or 1.6499999999999999e-26 < y

    1. Initial program 97.2%

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

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

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

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

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

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

    if -2.0999999999999999e-14 < y < 1.6499999999999999e-26

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 76.2% accurate, 2.5× speedup?

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

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

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

\mathbf{elif}\;y \leq 1.85 \cdot 10^{+155} \lor \neg \left(y \leq 2 \cdot 10^{+262}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -0.00759999999999999998 or 6.1999999999999998e-15 < y < 1.8499999999999999e155 or 2e262 < y

    1. Initial program 97.4%

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

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

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

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

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

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

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

    if -0.00759999999999999998 < y < 6.1999999999999998e-15

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8499999999999999e155 < y < 2e262

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.0076:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-15}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+155} \lor \neg \left(y \leq 2 \cdot 10^{+262}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 72.2% accurate, 2.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.1000000000000002e22 or 2.0000000000000001e-18 < t

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

    if -3.1000000000000002e22 < t < -4.8000000000000002e-69

    1. Initial program 89.0%

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

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

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

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

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

    if -4.8000000000000002e-69 < t < 2.0000000000000001e-18

    1. Initial program 94.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.1 \cdot 10^{+22}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{elif}\;t \leq -4.8 \cdot 10^{-69}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-18}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.6% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.82 \lor \neg \left(y \leq 6.2 \cdot 10^{-15}\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 -0.82) (not (<= y 6.2e-15)))
   (* 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 <= -0.82) || !(y <= 6.2e-15)) {
		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 <= (-0.82d0)) .or. (.not. (y <= 6.2d-15))) 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 <= -0.82) || !(y <= 6.2e-15)) {
		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 <= -0.82) or not (y <= 6.2e-15):
		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 <= -0.82) || !(y <= 6.2e-15))
		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 <= -0.82) || ~((y <= 6.2e-15)))
		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, -0.82], N[Not[LessEqual[y, 6.2e-15]], $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 -0.82 \lor \neg \left(y \leq 6.2 \cdot 10^{-15}\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 < -0.819999999999999951 or 6.1999999999999998e-15 < y

    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-define97.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-define100.0%

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

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

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

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

    if -0.819999999999999951 < y < 6.1999999999999998e-15

    1. Initial program 95.9%

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

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

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

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

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

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

Alternative 7: 55.2% accurate, 2.9× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. fma-define98.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-define100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.30000000000000005e-6 < t

    1. Initial program 95.9%

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

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

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

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

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

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

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

Alternative 8: 31.7% accurate, 10.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{if}\;y \leq -1.65 \cdot 10^{+214}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{+151}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{+70}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 58:\\ \;\;\;\;x - a \cdot \left(x \cdot b\right)\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{+105}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* x (- z)))))
   (if (<= y -1.65e+214)
     (* x (* a (- b)))
     (if (<= y -2.2e+151)
       (* x (- 1.0 (* y t)))
       (if (<= y -4.8e+70)
         t_1
         (if (<= y 58.0)
           (- x (* a (* x b)))
           (if (<= y 1.02e+105) t_1 (* x (* t (- y))))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (x * -z);
	double tmp;
	if (y <= -1.65e+214) {
		tmp = x * (a * -b);
	} else if (y <= -2.2e+151) {
		tmp = x * (1.0 - (y * t));
	} else if (y <= -4.8e+70) {
		tmp = t_1;
	} else if (y <= 58.0) {
		tmp = x - (a * (x * b));
	} else if (y <= 1.02e+105) {
		tmp = t_1;
	} else {
		tmp = x * (t * -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) :: t_1
    real(8) :: tmp
    t_1 = a * (x * -z)
    if (y <= (-1.65d+214)) then
        tmp = x * (a * -b)
    else if (y <= (-2.2d+151)) then
        tmp = x * (1.0d0 - (y * t))
    else if (y <= (-4.8d+70)) then
        tmp = t_1
    else if (y <= 58.0d0) then
        tmp = x - (a * (x * b))
    else if (y <= 1.02d+105) then
        tmp = t_1
    else
        tmp = x * (t * -y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (x * -z);
	double tmp;
	if (y <= -1.65e+214) {
		tmp = x * (a * -b);
	} else if (y <= -2.2e+151) {
		tmp = x * (1.0 - (y * t));
	} else if (y <= -4.8e+70) {
		tmp = t_1;
	} else if (y <= 58.0) {
		tmp = x - (a * (x * b));
	} else if (y <= 1.02e+105) {
		tmp = t_1;
	} else {
		tmp = x * (t * -y);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = a * (x * -z)
	tmp = 0
	if y <= -1.65e+214:
		tmp = x * (a * -b)
	elif y <= -2.2e+151:
		tmp = x * (1.0 - (y * t))
	elif y <= -4.8e+70:
		tmp = t_1
	elif y <= 58.0:
		tmp = x - (a * (x * b))
	elif y <= 1.02e+105:
		tmp = t_1
	else:
		tmp = x * (t * -y)
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(x * Float64(-z)))
	tmp = 0.0
	if (y <= -1.65e+214)
		tmp = Float64(x * Float64(a * Float64(-b)));
	elseif (y <= -2.2e+151)
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	elseif (y <= -4.8e+70)
		tmp = t_1;
	elseif (y <= 58.0)
		tmp = Float64(x - Float64(a * Float64(x * b)));
	elseif (y <= 1.02e+105)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(t * Float64(-y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (x * -z);
	tmp = 0.0;
	if (y <= -1.65e+214)
		tmp = x * (a * -b);
	elseif (y <= -2.2e+151)
		tmp = x * (1.0 - (y * t));
	elseif (y <= -4.8e+70)
		tmp = t_1;
	elseif (y <= 58.0)
		tmp = x - (a * (x * b));
	elseif (y <= 1.02e+105)
		tmp = t_1;
	else
		tmp = x * (t * -y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.65e+214], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.2e+151], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.8e+70], t$95$1, If[LessEqual[y, 58.0], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e+105], t$95$1, N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{elif}\;y \leq 1.02 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.65000000000000006e214

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.65000000000000006e214 < y < -2.20000000000000007e151

    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. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000007e151 < y < -4.79999999999999974e70 or 58 < y < 1.02e105

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.79999999999999974e70 < y < 58

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

    if 1.02e105 < y

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+214}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{+151}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{+70}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;y \leq 58:\\ \;\;\;\;x - a \cdot \left(x \cdot b\right)\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{+105}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 26.5% accurate, 10.1× speedup?

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

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

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

\mathbf{elif}\;y \leq -3.7 \cdot 10^{-36}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 9.8 \cdot 10^{-138}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.45000000000000007e216 or -2.2499999999999999e134 < y < -3.70000000000000002e-36

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.45000000000000007e216 < y < -2.2499999999999999e134 or 2.4500000000000001e107 < 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. Step-by-step derivation
      1. fma-define98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.70000000000000002e-36 < y < 9.80000000000000033e-138

    1. Initial program 96.6%

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

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

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

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

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

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

    if 9.80000000000000033e-138 < y < 2.4500000000000001e107

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.45 \cdot 10^{+216}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq -2.25 \cdot 10^{+134}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -3.7 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{-138}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.45 \cdot 10^{+107}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 26.1% accurate, 10.1× speedup?

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

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

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

\mathbf{elif}\;y \leq -1.5 \cdot 10^{-35}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 1.45 \cdot 10^{-136}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.8000000000000002e215 or -1.2e131 < y < -1.49999999999999994e-35

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.8000000000000002e215 < y < -1.2e131 or 1.65000000000000006e101 < 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. Step-by-step derivation
      1. fma-define98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.49999999999999994e-35 < y < 1.44999999999999997e-136

    1. Initial program 95.5%

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

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

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

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

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

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

    if 1.44999999999999997e-136 < y < 1.65000000000000006e101

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+215}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{+131}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{-35}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-136}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+101}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 32.9% accurate, 11.6× speedup?

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

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

\mathbf{elif}\;a \leq 126000000:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{elif}\;a \leq 1.3 \cdot 10^{+87}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

\mathbf{elif}\;a \leq 3.2 \cdot 10^{+242}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -1.15e21

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.15e21 < a < 1.26e8

    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. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.26e8 < a < 1.29999999999999999e87

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.29999999999999999e87 < a < 3.2000000000000002e242

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000002e242 < a

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.15 \cdot 10^{+21}:\\ \;\;\;\;x - z \cdot \left(a \cdot \left(x + \frac{x \cdot b}{z}\right)\right)\\ \mathbf{elif}\;a \leq 126000000:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{+87}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+242}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 30.7% accurate, 11.6× speedup?

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

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

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

\mathbf{elif}\;a \leq -6.5 \cdot 10^{+19}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -1.02e223

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.02e223 < a < -2.85000000000000008e82

    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. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.85000000000000008e82 < a < -6.5e19

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.5e19 < a < 3.7999999999999999e98

    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. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.7999999999999999e98 < a

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.02 \cdot 10^{+223}:\\ \;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;a \leq -2.85 \cdot 10^{+82}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;a \leq -6.5 \cdot 10^{+19}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{+98}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 32.6% accurate, 12.1× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.3999999999999999e216

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3999999999999999e216 < y < -1.04999999999999997e132

    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. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.04999999999999997e132 < y < 0.10000000000000001

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.10000000000000001 < y < 7.2000000000000002e106

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.2000000000000002e106 < y

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 26.9% accurate, 12.1× speedup?

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

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

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

\mathbf{elif}\;y \leq -1.8 \cdot 10^{-36}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 9.8 \cdot 10^{-23}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.3199999999999999e216 or -3.49999999999999969e128 < y < -1.80000000000000016e-36

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3199999999999999e216 < y < -3.49999999999999969e128 or 9.7999999999999996e-23 < y

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.80000000000000016e-36 < y < 9.7999999999999996e-23

    1. Initial program 96.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.32 \cdot 10^{+216}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{+128}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{-23}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 32.0% accurate, 14.3× speedup?

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

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

\mathbf{elif}\;a \leq 5500000:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{elif}\;a \leq 2.6 \cdot 10^{+86}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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


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

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(x \cdot \left(b + z\right)\right) \cdot a} \]
      4. *-commutative25.2%

        \[\leadsto x - \color{blue}{\left(\left(b + z\right) \cdot x\right)} \cdot a \]
      5. associate-*l*29.7%

        \[\leadsto x - \color{blue}{\left(b + z\right) \cdot \left(x \cdot a\right)} \]
      6. +-commutative29.7%

        \[\leadsto x - \color{blue}{\left(z + b\right)} \cdot \left(x \cdot a\right) \]
    11. Simplified29.7%

      \[\leadsto \color{blue}{x - \left(z + b\right) \cdot \left(x \cdot a\right)} \]
    12. Taylor expanded in b around inf 31.0%

      \[\leadsto x - \color{blue}{b \cdot \left(a \cdot x + \frac{a \cdot \left(x \cdot z\right)}{b}\right)} \]
    13. Step-by-step derivation
      1. +-commutative31.0%

        \[\leadsto x - b \cdot \color{blue}{\left(\frac{a \cdot \left(x \cdot z\right)}{b} + a \cdot x\right)} \]
      2. associate-/l*31.1%

        \[\leadsto x - b \cdot \left(\color{blue}{a \cdot \frac{x \cdot z}{b}} + a \cdot x\right) \]
      3. distribute-lft-out34.3%

        \[\leadsto x - b \cdot \color{blue}{\left(a \cdot \left(\frac{x \cdot z}{b} + x\right)\right)} \]
      4. *-commutative34.3%

        \[\leadsto x - b \cdot \left(a \cdot \left(\frac{\color{blue}{z \cdot x}}{b} + x\right)\right) \]
      5. associate-/l*34.3%

        \[\leadsto x - b \cdot \left(a \cdot \left(\color{blue}{z \cdot \frac{x}{b}} + x\right)\right) \]
    14. Simplified34.3%

      \[\leadsto x - \color{blue}{b \cdot \left(a \cdot \left(z \cdot \frac{x}{b} + x\right)\right)} \]

    if -7.50000000000000014e24 < a < 5.5e6

    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. Step-by-step derivation
      1. fma-define100.0%

        \[\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-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-define100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 90.5%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    6. Taylor expanded in t around inf 73.0%

      \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-1 \cdot t\right)}} \]
    7. Step-by-step derivation
      1. neg-mul-173.0%

        \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-t\right)}} \]
    8. Simplified73.0%

      \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-t\right)}} \]
    9. Taylor expanded in y around 0 44.3%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg44.3%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. unsub-neg44.3%

        \[\leadsto x \cdot \color{blue}{\left(1 - t \cdot y\right)} \]
      3. *-commutative44.3%

        \[\leadsto x \cdot \left(1 - \color{blue}{y \cdot t}\right) \]
    11. Simplified44.3%

      \[\leadsto x \cdot \color{blue}{\left(1 - y \cdot t\right)} \]

    if 5.5e6 < a < 2.5999999999999998e86

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 72.2%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg72.2%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define72.2%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified72.2%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 72.2%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. +-commutative72.2%

        \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot z\right) + -1 \cdot \left(a \cdot b\right)}} \]
      2. associate-*r*72.2%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot z} + -1 \cdot \left(a \cdot b\right)} \]
      3. associate-*r*72.2%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      4. distribute-lft-out72.2%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      5. mul-1-neg72.2%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(z + b\right)} \]
    8. Simplified72.2%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(z + b\right)}} \]
    9. Taylor expanded in a around 0 5.6%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg5.6%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
      2. unsub-neg5.6%

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot \left(b + z\right)\right)} \]
      3. *-commutative5.6%

        \[\leadsto x - \color{blue}{\left(x \cdot \left(b + z\right)\right) \cdot a} \]
      4. *-commutative5.6%

        \[\leadsto x - \color{blue}{\left(\left(b + z\right) \cdot x\right)} \cdot a \]
      5. associate-*l*2.9%

        \[\leadsto x - \color{blue}{\left(b + z\right) \cdot \left(x \cdot a\right)} \]
      6. +-commutative2.9%

        \[\leadsto x - \color{blue}{\left(z + b\right)} \cdot \left(x \cdot a\right) \]
    11. Simplified2.9%

      \[\leadsto \color{blue}{x - \left(z + b\right) \cdot \left(x \cdot a\right)} \]
    12. Taylor expanded in z around inf 33.2%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]

    if 2.5999999999999998e86 < a

    1. Initial program 87.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 63.5%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg63.5%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define77.9%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified77.9%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 77.9%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. +-commutative77.9%

        \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot z\right) + -1 \cdot \left(a \cdot b\right)}} \]
      2. associate-*r*77.9%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot z} + -1 \cdot \left(a \cdot b\right)} \]
      3. associate-*r*77.9%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      4. distribute-lft-out77.9%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      5. mul-1-neg77.9%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(z + b\right)} \]
    8. Simplified77.9%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(z + b\right)}} \]
    9. Taylor expanded in a around 0 27.3%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg27.3%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
      2. unsub-neg27.3%

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot \left(b + z\right)\right)} \]
      3. *-commutative27.3%

        \[\leadsto x - \color{blue}{\left(x \cdot \left(b + z\right)\right) \cdot a} \]
      4. *-commutative27.3%

        \[\leadsto x - \color{blue}{\left(\left(b + z\right) \cdot x\right)} \cdot a \]
      5. associate-*l*27.2%

        \[\leadsto x - \color{blue}{\left(b + z\right) \cdot \left(x \cdot a\right)} \]
      6. +-commutative27.2%

        \[\leadsto x - \color{blue}{\left(z + b\right)} \cdot \left(x \cdot a\right) \]
    11. Simplified27.2%

      \[\leadsto \color{blue}{x - \left(z + b\right) \cdot \left(x \cdot a\right)} \]
    12. Taylor expanded in z around 0 27.4%

      \[\leadsto x - \color{blue}{a \cdot \left(b \cdot x\right)} \]
    13. Step-by-step derivation
      1. associate-*r*36.6%

        \[\leadsto x - \color{blue}{\left(a \cdot b\right) \cdot x} \]
      2. *-commutative36.6%

        \[\leadsto x - \color{blue}{x \cdot \left(a \cdot b\right)} \]
    14. Simplified36.6%

      \[\leadsto x - \color{blue}{x \cdot \left(a \cdot b\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification40.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.5 \cdot 10^{+24}:\\ \;\;\;\;x - b \cdot \left(a \cdot \left(x + z \cdot \frac{x}{b}\right)\right)\\ \mathbf{elif}\;a \leq 5500000:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{+86}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 31.4% accurate, 14.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -6.8 \cdot 10^{+23}:\\ \;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;a \leq 116000000:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;a \leq 1.75 \cdot 10^{+86}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -6.8e+23)
   (- x (* (+ z b) (* x a)))
   (if (<= a 116000000.0)
     (* x (- 1.0 (* y t)))
     (if (<= a 1.75e+86) (* a (* x (- z))) (- x (* x (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -6.8e+23) {
		tmp = x - ((z + b) * (x * a));
	} else if (a <= 116000000.0) {
		tmp = x * (1.0 - (y * t));
	} else if (a <= 1.75e+86) {
		tmp = a * (x * -z);
	} else {
		tmp = x - (x * (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 (a <= (-6.8d+23)) then
        tmp = x - ((z + b) * (x * a))
    else if (a <= 116000000.0d0) then
        tmp = x * (1.0d0 - (y * t))
    else if (a <= 1.75d+86) then
        tmp = a * (x * -z)
    else
        tmp = x - (x * (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 (a <= -6.8e+23) {
		tmp = x - ((z + b) * (x * a));
	} else if (a <= 116000000.0) {
		tmp = x * (1.0 - (y * t));
	} else if (a <= 1.75e+86) {
		tmp = a * (x * -z);
	} else {
		tmp = x - (x * (a * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -6.8e+23:
		tmp = x - ((z + b) * (x * a))
	elif a <= 116000000.0:
		tmp = x * (1.0 - (y * t))
	elif a <= 1.75e+86:
		tmp = a * (x * -z)
	else:
		tmp = x - (x * (a * b))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -6.8e+23)
		tmp = Float64(x - Float64(Float64(z + b) * Float64(x * a)));
	elseif (a <= 116000000.0)
		tmp = Float64(x * Float64(1.0 - Float64(y * t)));
	elseif (a <= 1.75e+86)
		tmp = Float64(a * Float64(x * Float64(-z)));
	else
		tmp = Float64(x - Float64(x * Float64(a * b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -6.8e+23)
		tmp = x - ((z + b) * (x * a));
	elseif (a <= 116000000.0)
		tmp = x * (1.0 - (y * t));
	elseif (a <= 1.75e+86)
		tmp = a * (x * -z);
	else
		tmp = x - (x * (a * b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.8e+23], N[(x - N[(N[(z + b), $MachinePrecision] * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 116000000.0], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.75e+86], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+23}:\\
\;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\

\mathbf{elif}\;a \leq 116000000:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\mathbf{elif}\;a \leq 1.75 \cdot 10^{+86}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -6.79999999999999983e23

    1. Initial program 93.7%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 74.8%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg74.8%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define84.2%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified84.2%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 84.2%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. +-commutative84.2%

        \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot z\right) + -1 \cdot \left(a \cdot b\right)}} \]
      2. associate-*r*84.2%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot z} + -1 \cdot \left(a \cdot b\right)} \]
      3. associate-*r*84.2%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      4. distribute-lft-out84.2%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      5. mul-1-neg84.2%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(z + b\right)} \]
    8. Simplified84.2%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(z + b\right)}} \]
    9. Taylor expanded in a around 0 25.2%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg25.2%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
      2. unsub-neg25.2%

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot \left(b + z\right)\right)} \]
      3. *-commutative25.2%

        \[\leadsto x - \color{blue}{\left(x \cdot \left(b + z\right)\right) \cdot a} \]
      4. *-commutative25.2%

        \[\leadsto x - \color{blue}{\left(\left(b + z\right) \cdot x\right)} \cdot a \]
      5. associate-*l*29.7%

        \[\leadsto x - \color{blue}{\left(b + z\right) \cdot \left(x \cdot a\right)} \]
      6. +-commutative29.7%

        \[\leadsto x - \color{blue}{\left(z + b\right)} \cdot \left(x \cdot a\right) \]
    11. Simplified29.7%

      \[\leadsto \color{blue}{x - \left(z + b\right) \cdot \left(x \cdot a\right)} \]

    if -6.79999999999999983e23 < a < 1.16e8

    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. Step-by-step derivation
      1. fma-define100.0%

        \[\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-neg100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
      3. log1p-define100.0%

        \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 90.5%

      \[\leadsto \color{blue}{x \cdot e^{y \cdot \left(\log z - t\right)}} \]
    6. Taylor expanded in t around inf 73.0%

      \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-1 \cdot t\right)}} \]
    7. Step-by-step derivation
      1. neg-mul-173.0%

        \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-t\right)}} \]
    8. Simplified73.0%

      \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-t\right)}} \]
    9. Taylor expanded in y around 0 44.3%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg44.3%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. unsub-neg44.3%

        \[\leadsto x \cdot \color{blue}{\left(1 - t \cdot y\right)} \]
      3. *-commutative44.3%

        \[\leadsto x \cdot \left(1 - \color{blue}{y \cdot t}\right) \]
    11. Simplified44.3%

      \[\leadsto x \cdot \color{blue}{\left(1 - y \cdot t\right)} \]

    if 1.16e8 < a < 1.75000000000000009e86

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 72.2%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg72.2%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define72.2%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified72.2%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 72.2%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. +-commutative72.2%

        \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot z\right) + -1 \cdot \left(a \cdot b\right)}} \]
      2. associate-*r*72.2%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot z} + -1 \cdot \left(a \cdot b\right)} \]
      3. associate-*r*72.2%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      4. distribute-lft-out72.2%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      5. mul-1-neg72.2%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(z + b\right)} \]
    8. Simplified72.2%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(z + b\right)}} \]
    9. Taylor expanded in a around 0 5.6%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg5.6%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
      2. unsub-neg5.6%

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot \left(b + z\right)\right)} \]
      3. *-commutative5.6%

        \[\leadsto x - \color{blue}{\left(x \cdot \left(b + z\right)\right) \cdot a} \]
      4. *-commutative5.6%

        \[\leadsto x - \color{blue}{\left(\left(b + z\right) \cdot x\right)} \cdot a \]
      5. associate-*l*2.9%

        \[\leadsto x - \color{blue}{\left(b + z\right) \cdot \left(x \cdot a\right)} \]
      6. +-commutative2.9%

        \[\leadsto x - \color{blue}{\left(z + b\right)} \cdot \left(x \cdot a\right) \]
    11. Simplified2.9%

      \[\leadsto \color{blue}{x - \left(z + b\right) \cdot \left(x \cdot a\right)} \]
    12. Taylor expanded in z around inf 33.2%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]

    if 1.75000000000000009e86 < a

    1. Initial program 87.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 63.5%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg63.5%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define77.9%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified77.9%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 77.9%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. +-commutative77.9%

        \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot z\right) + -1 \cdot \left(a \cdot b\right)}} \]
      2. associate-*r*77.9%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot z} + -1 \cdot \left(a \cdot b\right)} \]
      3. associate-*r*77.9%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      4. distribute-lft-out77.9%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      5. mul-1-neg77.9%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(z + b\right)} \]
    8. Simplified77.9%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(z + b\right)}} \]
    9. Taylor expanded in a around 0 27.3%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg27.3%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
      2. unsub-neg27.3%

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot \left(b + z\right)\right)} \]
      3. *-commutative27.3%

        \[\leadsto x - \color{blue}{\left(x \cdot \left(b + z\right)\right) \cdot a} \]
      4. *-commutative27.3%

        \[\leadsto x - \color{blue}{\left(\left(b + z\right) \cdot x\right)} \cdot a \]
      5. associate-*l*27.2%

        \[\leadsto x - \color{blue}{\left(b + z\right) \cdot \left(x \cdot a\right)} \]
      6. +-commutative27.2%

        \[\leadsto x - \color{blue}{\left(z + b\right)} \cdot \left(x \cdot a\right) \]
    11. Simplified27.2%

      \[\leadsto \color{blue}{x - \left(z + b\right) \cdot \left(x \cdot a\right)} \]
    12. Taylor expanded in z around 0 27.4%

      \[\leadsto x - \color{blue}{a \cdot \left(b \cdot x\right)} \]
    13. Step-by-step derivation
      1. associate-*r*36.6%

        \[\leadsto x - \color{blue}{\left(a \cdot b\right) \cdot x} \]
      2. *-commutative36.6%

        \[\leadsto x - \color{blue}{x \cdot \left(a \cdot b\right)} \]
    14. Simplified36.6%

      \[\leadsto x - \color{blue}{x \cdot \left(a \cdot b\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification38.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.8 \cdot 10^{+23}:\\ \;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;a \leq 116000000:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;a \leq 1.75 \cdot 10^{+86}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 27.5% accurate, 19.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{-38} \lor \neg \left(y \leq 4.5 \cdot 10^{-53}\right):\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -8.2e-38) (not (<= y 4.5e-53))) (* x (* a (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -8.2e-38) || !(y <= 4.5e-53)) {
		tmp = x * (a * -b);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((y <= (-8.2d-38)) .or. (.not. (y <= 4.5d-53))) then
        tmp = x * (a * -b)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -8.2e-38) || !(y <= 4.5e-53)) {
		tmp = x * (a * -b);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -8.2e-38) or not (y <= 4.5e-53):
		tmp = x * (a * -b)
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -8.2e-38) || !(y <= 4.5e-53))
		tmp = Float64(x * Float64(a * Float64(-b)));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -8.2e-38) || ~((y <= 4.5e-53)))
		tmp = x * (a * -b);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.2e-38], N[Not[LessEqual[y, 4.5e-53]], $MachinePrecision]], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-38} \lor \neg \left(y \leq 4.5 \cdot 10^{-53}\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.1999999999999996e-38 or 4.49999999999999985e-53 < y

    1. Initial program 96.8%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 40.0%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. sub-neg40.0%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)} \]
      2. log1p-define45.0%

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(-z\right)} - b\right)} \]
    5. Simplified45.0%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 45.0%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. +-commutative45.0%

        \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot z\right) + -1 \cdot \left(a \cdot b\right)}} \]
      2. associate-*r*45.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot z} + -1 \cdot \left(a \cdot b\right)} \]
      3. associate-*r*45.0%

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      4. distribute-lft-out45.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      5. mul-1-neg45.0%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(z + b\right)} \]
    8. Simplified45.0%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(z + b\right)}} \]
    9. Taylor expanded in a around 0 17.0%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg17.0%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(x \cdot \left(b + z\right)\right)\right)} \]
      2. unsub-neg17.0%

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot \left(b + z\right)\right)} \]
      3. *-commutative17.0%

        \[\leadsto x - \color{blue}{\left(x \cdot \left(b + z\right)\right) \cdot a} \]
      4. *-commutative17.0%

        \[\leadsto x - \color{blue}{\left(\left(b + z\right) \cdot x\right)} \cdot a \]
      5. associate-*l*17.1%

        \[\leadsto x - \color{blue}{\left(b + z\right) \cdot \left(x \cdot a\right)} \]
      6. +-commutative17.1%

        \[\leadsto x - \color{blue}{\left(z + b\right)} \cdot \left(x \cdot a\right) \]
    11. Simplified17.1%

      \[\leadsto \color{blue}{x - \left(z + b\right) \cdot \left(x \cdot a\right)} \]
    12. Taylor expanded in b around inf 22.8%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    13. Step-by-step derivation
      1. mul-1-neg22.8%

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. associate-*r*24.0%

        \[\leadsto -\color{blue}{\left(a \cdot b\right) \cdot x} \]
      3. *-commutative24.0%

        \[\leadsto -\color{blue}{x \cdot \left(a \cdot b\right)} \]
      4. distribute-rgt-neg-in24.0%

        \[\leadsto \color{blue}{x \cdot \left(-a \cdot b\right)} \]
      5. *-commutative24.0%

        \[\leadsto x \cdot \left(-\color{blue}{b \cdot a}\right) \]
      6. distribute-rgt-neg-in24.0%

        \[\leadsto x \cdot \color{blue}{\left(b \cdot \left(-a\right)\right)} \]
    14. Simplified24.0%

      \[\leadsto \color{blue}{x \cdot \left(b \cdot \left(-a\right)\right)} \]

    if -8.1999999999999996e-38 < y < 4.49999999999999985e-53

    1. Initial program 96.1%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in b around inf 82.9%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    4. Step-by-step derivation
      1. mul-1-neg82.9%

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out82.9%

        \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]
    5. Simplified82.9%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]
    6. Taylor expanded in a around 0 39.5%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{-38} \lor \neg \left(y \leq 4.5 \cdot 10^{-53}\right):\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 19.4% accurate, 315.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 96.5%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in b around inf 56.9%

    \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
  4. Step-by-step derivation
    1. mul-1-neg56.9%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    2. distribute-rgt-neg-out56.9%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]
  5. Simplified56.9%

    \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(-b\right)}} \]
  6. Taylor expanded in a around 0 18.4%

    \[\leadsto \color{blue}{x} \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2024096 
(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))))))