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

Percentage Accurate: 96.6% → 99.6%
Time: 14.9s
Alternatives: 16
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 96.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 97.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.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-neg98.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-define99.6%

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

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

Alternative 2: 87.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-9} \lor \neg \left(y \leq 4.5 \cdot 10^{-41}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.2000000000000001e-9 or 4.5e-41 < 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-define98.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-neg98.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-define99.3%

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

      \[\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 89.6%

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

    if -6.2000000000000001e-9 < y < 4.5e-41

    1. Initial program 97.5%

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

      \[\leadsto \color{blue}{x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 89.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. associate-*r*100.0%

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

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

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

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

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

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

Alternative 3: 99.2% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 4: 76.4% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -160 \lor \neg \left(y \leq 0.37\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -160 or 0.37 < y

    1. Initial program 96.9%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. 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-define99.2%

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

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

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

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

    if -160 < y < 0.37

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 73.5% accurate, 2.7× speedup?

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

    1. Initial program 96.9%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. 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-define99.2%

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

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

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

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

    if -0.049000000000000002 < y < 1.44999999999999996

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 53.2% accurate, 2.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.94999999999999984e172 < t

    1. Initial program 97.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. 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 70.7%

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

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

Alternative 7: 33.0% accurate, 13.1× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7.2000000000000004e88

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.2000000000000004e88 < y < 6.5e-23

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

      \[\leadsto \color{blue}{x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    6. Taylor expanded in z around 0 83.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. associate-*r*100.0%

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
    9. Taylor expanded in a around 0 43.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-neg43.3%

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

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

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

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

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

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

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

    if 6.5e-23 < y < 7.5e31

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.5e31 < y

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 31.5% accurate, 13.1× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.59999999999999979e86

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.59999999999999979e86 < y < 9.8000000000000002e-24

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

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

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

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

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

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

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

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

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

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

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

    if 9.8000000000000002e-24 < y < 1.00000000000000005e32

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000005e32 < y

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{+86}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 9.8 \cdot 10^{-24}:\\ \;\;\;\;x - a \cdot \left(x \cdot b\right)\\ \mathbf{elif}\;y \leq 10^{+32}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\frac{x}{y} - x \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 31.7% accurate, 18.5× speedup?

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

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

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

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


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.20000000000000023e85 < y < 7.4000000000000005e-23

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

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

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

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

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

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

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

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

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

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

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

    if 7.4000000000000005e-23 < y

    1. Initial program 97.3%

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

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

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

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

      \[\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 y around 0 40.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+85}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-23}:\\ \;\;\;\;x - a \cdot \left(x \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 32.8% accurate, 18.5× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1e89 < y < 4.3999999999999999e-23

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.3999999999999999e-23 < y

    1. Initial program 97.3%

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

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

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

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

      \[\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 y around 0 40.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 27.1% accurate, 18.5× speedup?

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

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

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

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


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

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.1999999999999994e-67 < y < 2.0000000000000001e-62

    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. Add Preprocessing
    3. Taylor expanded in z around 0 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + y \cdot \color{blue}{\left(0 + \left(-t\right)\right)}\right) \]
      3. add-sqr-sqrt23.6%

        \[\leadsto x \cdot \left(1 + y \cdot \left(0 + \color{blue}{\sqrt{-t} \cdot \sqrt{-t}}\right)\right) \]
      4. sqrt-unprod43.3%

        \[\leadsto x \cdot \left(1 + y \cdot \left(0 + \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}\right)\right) \]
      5. sqr-neg43.3%

        \[\leadsto x \cdot \left(1 + y \cdot \left(0 + \sqrt{\color{blue}{t \cdot t}}\right)\right) \]
      6. sqrt-unprod21.4%

        \[\leadsto x \cdot \left(1 + y \cdot \left(0 + \color{blue}{\sqrt{t} \cdot \sqrt{t}}\right)\right) \]
      7. add-sqr-sqrt44.3%

        \[\leadsto x \cdot \left(1 + y \cdot \left(0 + \color{blue}{t}\right)\right) \]
    13. Applied egg-rr44.3%

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

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

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

    if 2.0000000000000001e-62 < y

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 26.3% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-46} \lor \neg \left(y \leq 1.56 \cdot 10^{-62}\right):\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.1e-46 or 1.56000000000000009e-62 < 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-define98.7%

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

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

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

      \[\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 y around 0 41.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e-46 < y < 1.56000000000000009e-62

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

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

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

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

Alternative 13: 27.2% accurate, 19.6× speedup?

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

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

\mathbf{elif}\;y \leq 2 \cdot 10^{-62}:\\
\;\;\;\;x\\

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


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

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.90000000000000003e-62 < y < 2.0000000000000001e-62

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

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

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

    if 2.0000000000000001e-62 < y

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 27.0% accurate, 19.6× speedup?

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

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

\mathbf{elif}\;y \leq 1.86 \cdot 10^{-62}:\\
\;\;\;\;x\\

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


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

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05e-62 < y < 1.86000000000000001e-62

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

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

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

    if 1.86000000000000001e-62 < y

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 26.3% accurate, 19.6× speedup?

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

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

\mathbf{elif}\;y \leq 1.2 \cdot 10^{-62}:\\
\;\;\;\;x\\

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


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

    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-define98.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-neg98.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 y around 0 39.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7000000000000001e-47 < y < 1.19999999999999992e-62

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

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

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

    if 1.19999999999999992e-62 < y

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 19.2% accurate, 315.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 97.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.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-neg98.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-define99.6%

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

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

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

    \[\leadsto \color{blue}{x} \]
  7. Add Preprocessing

Reproduce

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