
(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:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(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}
Initial program 97.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (* y (* y (* 0.5 (* t t))))))
(t_2 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_2 -2000000.0)
t_1
(if (<= t_2 0.0002)
(* x (fma b (fma 0.5 (* b (* a a)) (- a)) 1.0))
(if (<= t_2 4e+255)
t_1
(* x (fma t (- (* 0.5 (* t (* y y))) y) 1.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (y * (y * (0.5 * (t * t))));
double t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_2 <= -2000000.0) {
tmp = t_1;
} else if (t_2 <= 0.0002) {
tmp = x * fma(b, fma(0.5, (b * (a * a)), -a), 1.0);
} else if (t_2 <= 4e+255) {
tmp = t_1;
} else {
tmp = x * fma(t, ((0.5 * (t * (y * y))) - y), 1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(y * Float64(y * Float64(0.5 * Float64(t * t))))) t_2 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_2 <= -2000000.0) tmp = t_1; elseif (t_2 <= 0.0002) tmp = Float64(x * fma(b, fma(0.5, Float64(b * Float64(a * a)), Float64(-a)), 1.0)); elseif (t_2 <= 4e+255) tmp = t_1; else tmp = Float64(x * fma(t, Float64(Float64(0.5 * Float64(t * Float64(y * y))) - y), 1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(y * N[(y * N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, -2000000.0], t$95$1, If[LessEqual[t$95$2, 0.0002], N[(x * N[(b * N[(0.5 * N[(b * N[(a * a), $MachinePrecision]), $MachinePrecision] + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+255], t$95$1, N[(x * N[(t * N[(N[(0.5 * N[(t * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot \left(y \cdot \left(0.5 \cdot \left(t \cdot t\right)\right)\right)\right)\\
t_2 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_2 \leq -2000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0.0002:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), -a\right), 1\right)\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+255}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(t, 0.5 \cdot \left(t \cdot \left(y \cdot y\right)\right) - y, 1\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e6 or 2.0000000000000001e-4 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 3.99999999999999995e255Initial program 97.5%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6449.3
Simplified49.3%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
neg-lowering-neg.f6423.8
Simplified23.8%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6442.7
Simplified42.7%
if -2e6 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2.0000000000000001e-4Initial program 99.9%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6498.3
Simplified98.3%
Taylor expanded in b around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6497.1
Simplified97.1%
if 3.99999999999999995e255 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 94.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6453.0
Simplified53.0%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6469.1
Simplified69.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))
(t_2 (* t (* x (* 0.5 (* y (* y t)))))))
(if (<= t_1 -2e+209)
(* y (/ x y))
(if (<= t_1 -2000000.0)
t_2
(if (<= t_1 2e+36) (* x (- 1.0 (* a b))) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double t_2 = t * (x * (0.5 * (y * (y * t))));
double tmp;
if (t_1 <= -2e+209) {
tmp = y * (x / y);
} else if (t_1 <= -2000000.0) {
tmp = t_2;
} else if (t_1 <= 2e+36) {
tmp = x * (1.0 - (a * b));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
t_2 = t * (x * (0.5d0 * (y * (y * t))))
if (t_1 <= (-2d+209)) then
tmp = y * (x / y)
else if (t_1 <= (-2000000.0d0)) then
tmp = t_2
else if (t_1 <= 2d+36) then
tmp = x * (1.0d0 - (a * b))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
double t_2 = t * (x * (0.5 * (y * (y * t))));
double tmp;
if (t_1 <= -2e+209) {
tmp = y * (x / y);
} else if (t_1 <= -2000000.0) {
tmp = t_2;
} else if (t_1 <= 2e+36) {
tmp = x * (1.0 - (a * b));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b)) t_2 = t * (x * (0.5 * (y * (y * t)))) tmp = 0 if t_1 <= -2e+209: tmp = y * (x / y) elif t_1 <= -2000000.0: tmp = t_2 elif t_1 <= 2e+36: tmp = x * (1.0 - (a * b)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) t_2 = Float64(t * Float64(x * Float64(0.5 * Float64(y * Float64(y * t))))) tmp = 0.0 if (t_1 <= -2e+209) tmp = Float64(y * Float64(x / y)); elseif (t_1 <= -2000000.0) tmp = t_2; elseif (t_1 <= 2e+36) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b)); t_2 = t * (x * (0.5 * (y * (y * t)))); tmp = 0.0; if (t_1 <= -2e+209) tmp = y * (x / y); elseif (t_1 <= -2000000.0) tmp = t_2; elseif (t_1 <= 2e+36) tmp = x * (1.0 - (a * b)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(t * N[(x * N[(0.5 * N[(y * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+209], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2000000.0], t$95$2, If[LessEqual[t$95$1, 2e+36], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
t_2 := t \cdot \left(x \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot t\right)\right)\right)\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+209}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\mathbf{elif}\;t\_1 \leq -2000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2.0000000000000001e209Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6463.5
Simplified63.5%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f642.7
Simplified2.7%
Taylor expanded in y around inf
remove-double-negN/A
mul-1-negN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
distribute-lft-out--N/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f646.1
Simplified6.1%
Taylor expanded in t around 0
/-lowering-/.f6426.0
Simplified26.0%
if -2.0000000000000001e209 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e6 or 2.00000000000000008e36 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 95.5%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6446.1
Simplified46.1%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6437.0
Simplified37.0%
Taylor expanded in t around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6446.0
Simplified46.0%
if -2e6 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2.00000000000000008e36Initial program 99.9%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6490.8
Simplified90.8%
Taylor expanded in a around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6483.1
Simplified83.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(t_2 (* x (* y (* y (* 0.5 (* t t)))))))
(if (<= t_1 0.0)
t_2
(if (<= t_1 2.0) (* x (fma b (fma 0.5 (* b (* a a)) (- a)) 1.0)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
double t_2 = x * (y * (y * (0.5 * (t * t))));
double tmp;
if (t_1 <= 0.0) {
tmp = t_2;
} else if (t_1 <= 2.0) {
tmp = x * fma(b, fma(0.5, (b * (a * a)), -a), 1.0);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))) t_2 = Float64(x * Float64(y * Float64(y * Float64(0.5 * Float64(t * t))))) tmp = 0.0 if (t_1 <= 0.0) tmp = t_2; elseif (t_1 <= 2.0) tmp = Float64(x * fma(b, fma(0.5, Float64(b * Float64(a * a)), Float64(-a)), 1.0)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(x * N[(y * N[(y * N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], t$95$2, If[LessEqual[t$95$1, 2.0], N[(x * N[(b * N[(0.5 * N[(b * N[(a * a), $MachinePrecision]), $MachinePrecision] + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\
t_2 := x \cdot \left(y \cdot \left(y \cdot \left(0.5 \cdot \left(t \cdot t\right)\right)\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), -a\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) < 0.0 or 2 < (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) Initial program 96.7%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6450.2
Simplified50.2%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
neg-lowering-neg.f6433.9
Simplified33.9%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6447.7
Simplified47.7%
if 0.0 < (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) < 2Initial program 99.9%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6498.3
Simplified98.3%
Taylor expanded in b around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6497.1
Simplified97.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(t_2 (* x (* y (* y (* 0.5 (* t t)))))))
(if (<= t_1 0.0) t_2 (if (<= t_1 2.0) (* x (- 1.0 (* a b))) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
double t_2 = x * (y * (y * (0.5 * (t * t))));
double tmp;
if (t_1 <= 0.0) {
tmp = t_2;
} else if (t_1 <= 2.0) {
tmp = x * (1.0 - (a * b));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
t_2 = x * (y * (y * (0.5d0 * (t * t))))
if (t_1 <= 0.0d0) then
tmp = t_2
else if (t_1 <= 2.0d0) then
tmp = x * (1.0d0 - (a * b))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
double t_2 = x * (y * (y * (0.5 * (t * t))));
double tmp;
if (t_1 <= 0.0) {
tmp = t_2;
} else if (t_1 <= 2.0) {
tmp = x * (1.0 - (a * b));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b)))) t_2 = x * (y * (y * (0.5 * (t * t)))) tmp = 0 if t_1 <= 0.0: tmp = t_2 elif t_1 <= 2.0: tmp = x * (1.0 - (a * b)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))) t_2 = Float64(x * Float64(y * Float64(y * Float64(0.5 * Float64(t * t))))) tmp = 0.0 if (t_1 <= 0.0) tmp = t_2; elseif (t_1 <= 2.0) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); t_2 = x * (y * (y * (0.5 * (t * t)))); tmp = 0.0; if (t_1 <= 0.0) tmp = t_2; elseif (t_1 <= 2.0) tmp = x * (1.0 - (a * b)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(x * N[(y * N[(y * N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], t$95$2, If[LessEqual[t$95$1, 2.0], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\
t_2 := x \cdot \left(y \cdot \left(y \cdot \left(0.5 \cdot \left(t \cdot t\right)\right)\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) < 0.0 or 2 < (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) Initial program 96.7%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6450.2
Simplified50.2%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
neg-lowering-neg.f6433.9
Simplified33.9%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6447.7
Simplified47.7%
if 0.0 < (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) < 2Initial program 99.9%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6498.3
Simplified98.3%
Taylor expanded in a around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6496.0
Simplified96.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_1 -2000000.0)
(* x (* y (* y (* 0.5 (* t t)))))
(if (<= t_1 2e+152)
(* x (fma y (fma 0.5 (* y (* t t)) (- t)) 1.0))
(* x (fma t (- (* 0.5 (* t (* y y))) y) 1.0))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_1 <= -2000000.0) {
tmp = x * (y * (y * (0.5 * (t * t))));
} else if (t_1 <= 2e+152) {
tmp = x * fma(y, fma(0.5, (y * (t * t)), -t), 1.0);
} else {
tmp = x * fma(t, ((0.5 * (t * (y * y))) - y), 1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_1 <= -2000000.0) tmp = Float64(x * Float64(y * Float64(y * Float64(0.5 * Float64(t * t))))); elseif (t_1 <= 2e+152) tmp = Float64(x * fma(y, fma(0.5, Float64(y * Float64(t * t)), Float64(-t)), 1.0)); else tmp = Float64(x * fma(t, Float64(Float64(0.5 * Float64(t * Float64(y * y))) - y), 1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -2000000.0], N[(x * N[(y * N[(y * N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+152], N[(x * N[(y * N[(0.5 * N[(y * N[(t * t), $MachinePrecision]), $MachinePrecision] + (-t)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(t * N[(N[(0.5 * N[(t * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_1 \leq -2000000:\\
\;\;\;\;x \cdot \left(y \cdot \left(y \cdot \left(0.5 \cdot \left(t \cdot t\right)\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+152}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(0.5, y \cdot \left(t \cdot t\right), -t\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(t, 0.5 \cdot \left(t \cdot \left(y \cdot y\right)\right) - y, 1\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e6Initial program 98.9%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6452.5
Simplified52.5%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
neg-lowering-neg.f643.6
Simplified3.6%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6434.7
Simplified34.7%
if -2e6 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2.0000000000000001e152Initial program 97.5%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6473.0
Simplified73.0%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
neg-lowering-neg.f6469.4
Simplified69.4%
if 2.0000000000000001e152 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 95.4%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6448.9
Simplified48.9%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.4
Simplified67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_1 -2e+209)
(* y (/ x y))
(if (<= t_1 -2000000.0) (- (* x (* y t))) (* x (- 1.0 (* y t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_1 <= -2e+209) {
tmp = y * (x / y);
} else if (t_1 <= -2000000.0) {
tmp = -(x * (y * t));
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
if (t_1 <= (-2d+209)) then
tmp = y * (x / y)
else if (t_1 <= (-2000000.0d0)) then
tmp = -(x * (y * t))
else
tmp = x * (1.0d0 - (y * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
double tmp;
if (t_1 <= -2e+209) {
tmp = y * (x / y);
} else if (t_1 <= -2000000.0) {
tmp = -(x * (y * t));
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b)) tmp = 0 if t_1 <= -2e+209: tmp = y * (x / y) elif t_1 <= -2000000.0: tmp = -(x * (y * t)) else: tmp = x * (1.0 - (y * t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_1 <= -2e+209) tmp = Float64(y * Float64(x / y)); elseif (t_1 <= -2000000.0) tmp = Float64(-Float64(x * Float64(y * t))); else tmp = Float64(x * Float64(1.0 - Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b)); tmp = 0.0; if (t_1 <= -2e+209) tmp = y * (x / y); elseif (t_1 <= -2000000.0) tmp = -(x * (y * t)); else tmp = x * (1.0 - (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -2e+209], N[(y * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2000000.0], (-N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]), N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+209}:\\
\;\;\;\;y \cdot \frac{x}{y}\\
\mathbf{elif}\;t\_1 \leq -2000000:\\
\;\;\;\;-x \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2.0000000000000001e209Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6463.5
Simplified63.5%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f642.7
Simplified2.7%
Taylor expanded in y around inf
remove-double-negN/A
mul-1-negN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
distribute-lft-out--N/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f646.1
Simplified6.1%
Taylor expanded in t around 0
/-lowering-/.f6426.0
Simplified26.0%
if -2.0000000000000001e209 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e6Initial program 97.5%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6438.2
Simplified38.2%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f643.4
Simplified3.4%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6425.6
Simplified25.6%
if -2e6 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 96.4%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6460.5
Simplified60.5%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6442.4
Simplified42.4%
Final simplification36.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (* x (* y t))))
(t_2 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
(if (<= t_2 -2000000.0) t_1 (if (<= t_2 2e+36) x t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -(x * (y * t));
double t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double tmp;
if (t_2 <= -2000000.0) {
tmp = t_1;
} else if (t_2 <= 2e+36) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -(x * (y * t))
t_2 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
if (t_2 <= (-2000000.0d0)) then
tmp = t_1
else if (t_2 <= 2d+36) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -(x * (y * t));
double t_2 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
double tmp;
if (t_2 <= -2000000.0) {
tmp = t_1;
} else if (t_2 <= 2e+36) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -(x * (y * t)) t_2 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b)) tmp = 0 if t_2 <= -2000000.0: tmp = t_1 elif t_2 <= 2e+36: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(-Float64(x * Float64(y * t))) t_2 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) tmp = 0.0 if (t_2 <= -2000000.0) tmp = t_1; elseif (t_2 <= 2e+36) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -(x * (y * t)); t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b)); tmp = 0.0; if (t_2 <= -2000000.0) tmp = t_1; elseif (t_2 <= 2e+36) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = (-N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, -2000000.0], t$95$1, If[LessEqual[t$95$2, 2e+36], x, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -x \cdot \left(y \cdot t\right)\\
t_2 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_2 \leq -2000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+36}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e6 or 2.00000000000000008e36 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 96.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6450.4
Simplified50.4%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6412.4
Simplified12.4%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6421.5
Simplified21.5%
if -2e6 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2.00000000000000008e36Initial program 99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
log-lowering-log.f6490.3
Simplified90.3%
Taylor expanded in y around 0
Simplified81.1%
Final simplification33.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* a (- (- z) b))))))
(if (<= a -5.5e+100)
t_1
(if (<= a 1.45e-16) (* x (exp (* y (- (log z) t)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((a * (-z - b)));
double tmp;
if (a <= -5.5e+100) {
tmp = t_1;
} else if (a <= 1.45e-16) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * exp((a * (-z - b)))
if (a <= (-5.5d+100)) then
tmp = t_1
else if (a <= 1.45d-16) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp((a * (-z - b)));
double tmp;
if (a <= -5.5e+100) {
tmp = t_1;
} else if (a <= 1.45e-16) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((a * (-z - b))) tmp = 0 if a <= -5.5e+100: tmp = t_1 elif a <= 1.45e-16: tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))) tmp = 0.0 if (a <= -5.5e+100) tmp = t_1; elseif (a <= 1.45e-16) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((a * (-z - b))); tmp = 0.0; if (a <= -5.5e+100) tmp = t_1; elseif (a <= 1.45e-16) tmp = x * exp((y * (log(z) - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.5e+100], t$95$1, If[LessEqual[a, 1.45e-16], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{if}\;a \leq -5.5 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{-16}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.5000000000000002e100 or 1.4499999999999999e-16 < a Initial program 94.1%
Taylor expanded in y around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
accelerator-lowering-log1p.f64N/A
neg-lowering-neg.f6485.5
Simplified85.5%
Taylor expanded in z around 0
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6485.5
Simplified85.5%
if -5.5000000000000002e100 < a < 1.4499999999999999e-16Initial program 100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
log-lowering-log.f6488.6
Simplified88.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -3.1e-34)
t_1
(if (<= y -2.95e-167)
(* y (* y (* x (* 0.5 (* t t)))))
(if (<= y 2.4e+19)
(* x (fma b (fma 0.5 (* b (* a a)) (- a)) 1.0))
(if (<= y 1.06e+143)
(* x (* (* t t) (* -0.16666666666666666 (* t (* y (* y y))))))
t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * pow(z, y);
double tmp;
if (y <= -3.1e-34) {
tmp = t_1;
} else if (y <= -2.95e-167) {
tmp = y * (y * (x * (0.5 * (t * t))));
} else if (y <= 2.4e+19) {
tmp = x * fma(b, fma(0.5, (b * (a * a)), -a), 1.0);
} else if (y <= 1.06e+143) {
tmp = x * ((t * t) * (-0.16666666666666666 * (t * (y * (y * y)))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -3.1e-34) tmp = t_1; elseif (y <= -2.95e-167) tmp = Float64(y * Float64(y * Float64(x * Float64(0.5 * Float64(t * t))))); elseif (y <= 2.4e+19) tmp = Float64(x * fma(b, fma(0.5, Float64(b * Float64(a * a)), Float64(-a)), 1.0)); elseif (y <= 1.06e+143) tmp = Float64(x * Float64(Float64(t * t) * Float64(-0.16666666666666666 * Float64(t * Float64(y * Float64(y * y)))))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e-34], t$95$1, If[LessEqual[y, -2.95e-167], N[(y * N[(y * N[(x * N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e+19], N[(x * N[(b * N[(0.5 * N[(b * N[(a * a), $MachinePrecision]), $MachinePrecision] + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e+143], N[(x * N[(N[(t * t), $MachinePrecision] * N[(-0.16666666666666666 * N[(t * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.95 \cdot 10^{-167}:\\
\;\;\;\;y \cdot \left(y \cdot \left(x \cdot \left(0.5 \cdot \left(t \cdot t\right)\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), -a\right), 1\right)\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{+143}:\\
\;\;\;\;x \cdot \left(\left(t \cdot t\right) \cdot \left(-0.16666666666666666 \cdot \left(t \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.0999999999999998e-34 or 1.06e143 < y Initial program 94.5%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
log-lowering-log.f6483.0
Simplified83.0%
Taylor expanded in t around 0
*-lowering-*.f64N/A
pow-lowering-pow.f6464.0
Simplified64.0%
if -3.0999999999999998e-34 < y < -2.95000000000000011e-167Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6451.7
Simplified51.7%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
neg-lowering-neg.f6455.9
Simplified55.9%
Taylor expanded in y around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
Simplified59.3%
if -2.95000000000000011e-167 < y < 2.4e19Initial program 99.0%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6483.0
Simplified83.0%
Taylor expanded in b around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6461.5
Simplified61.5%
if 2.4e19 < y < 1.06e143Initial program 100.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6463.2
Simplified63.2%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified55.1%
Taylor expanded in t around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.3
Simplified67.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (- (* y t))))))
(if (<= t -1.5e+65)
t_1
(if (<= t 2.25e+136) (* x (exp (* a (- (- z) b)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp(-(y * t));
double tmp;
if (t <= -1.5e+65) {
tmp = t_1;
} else if (t <= 2.25e+136) {
tmp = x * exp((a * (-z - b)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * exp(-(y * t))
if (t <= (-1.5d+65)) then
tmp = t_1
else if (t <= 2.25d+136) then
tmp = x * exp((a * (-z - b)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp(-(y * t));
double tmp;
if (t <= -1.5e+65) {
tmp = t_1;
} else if (t <= 2.25e+136) {
tmp = x * Math.exp((a * (-z - b)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp(-(y * t)) tmp = 0 if t <= -1.5e+65: tmp = t_1 elif t <= 2.25e+136: tmp = x * math.exp((a * (-z - b))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(-Float64(y * t)))) tmp = 0.0 if (t <= -1.5e+65) tmp = t_1; elseif (t <= 2.25e+136) tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp(-(y * t)); tmp = 0.0; if (t <= -1.5e+65) tmp = t_1; elseif (t <= 2.25e+136) tmp = x * exp((a * (-z - b))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[(-N[(y * t), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.5e+65], t$95$1, If[LessEqual[t, 2.25e+136], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{-y \cdot t}\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+136}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.5000000000000001e65 or 2.25e136 < t Initial program 97.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6482.6
Simplified82.6%
if -1.5000000000000001e65 < t < 2.25e136Initial program 97.4%
Taylor expanded in y around 0
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
accelerator-lowering-log1p.f64N/A
neg-lowering-neg.f6478.7
Simplified78.7%
Taylor expanded in z around 0
--lowering--.f64N/A
mul-1-negN/A
neg-lowering-neg.f6478.7
Simplified78.7%
Final simplification80.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (exp (- (* y t)))))) (if (<= t -1.1e+27) t_1 (if (<= t 2.1e+84) (* x (exp (* a (- b)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp(-(y * t));
double tmp;
if (t <= -1.1e+27) {
tmp = t_1;
} else if (t <= 2.1e+84) {
tmp = x * exp((a * -b));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * exp(-(y * t))
if (t <= (-1.1d+27)) then
tmp = t_1
else if (t <= 2.1d+84) then
tmp = x * exp((a * -b))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp(-(y * t));
double tmp;
if (t <= -1.1e+27) {
tmp = t_1;
} else if (t <= 2.1e+84) {
tmp = x * Math.exp((a * -b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp(-(y * t)) tmp = 0 if t <= -1.1e+27: tmp = t_1 elif t <= 2.1e+84: tmp = x * math.exp((a * -b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(-Float64(y * t)))) tmp = 0.0 if (t <= -1.1e+27) tmp = t_1; elseif (t <= 2.1e+84) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp(-(y * t)); tmp = 0.0; if (t <= -1.1e+27) tmp = t_1; elseif (t <= 2.1e+84) tmp = x * exp((a * -b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[(-N[(y * t), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.1e+27], t$95$1, If[LessEqual[t, 2.1e+84], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{-y \cdot t}\\
\mathbf{if}\;t \leq -1.1 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+84}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.0999999999999999e27 or 2.10000000000000019e84 < t Initial program 96.5%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6481.0
Simplified81.0%
if -1.0999999999999999e27 < t < 2.10000000000000019e84Initial program 97.9%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6476.2
Simplified76.2%
Final simplification78.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (pow z y)))) (if (<= y -3.2e+28) t_1 (if (<= y 8.9e+164) (* x (exp (* a (- b)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * pow(z, y);
double tmp;
if (y <= -3.2e+28) {
tmp = t_1;
} else if (y <= 8.9e+164) {
tmp = x * exp((a * -b));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (y <= (-3.2d+28)) then
tmp = t_1
else if (y <= 8.9d+164) then
tmp = x * exp((a * -b))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.pow(z, y);
double tmp;
if (y <= -3.2e+28) {
tmp = t_1;
} else if (y <= 8.9e+164) {
tmp = x * Math.exp((a * -b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -3.2e+28: tmp = t_1 elif y <= 8.9e+164: tmp = x * math.exp((a * -b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -3.2e+28) tmp = t_1; elseif (y <= 8.9e+164) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -3.2e+28) tmp = t_1; elseif (y <= 8.9e+164) tmp = x * exp((a * -b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e+28], t$95$1, If[LessEqual[y, 8.9e+164], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.9 \cdot 10^{+164}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.2e28 or 8.8999999999999999e164 < y Initial program 94.6%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
log-lowering-log.f6488.2
Simplified88.2%
Taylor expanded in t around 0
*-lowering-*.f64N/A
pow-lowering-pow.f6467.9
Simplified67.9%
if -3.2e28 < y < 8.8999999999999999e164Initial program 98.8%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6476.0
Simplified76.0%
Final simplification73.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.7e+29) (* t (fma x (- y) (/ x t))) (if (<= y 2.8e+20) (* x (- 1.0 (* a b))) (- (* x (* y t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.7e+29) {
tmp = t * fma(x, -y, (x / t));
} else if (y <= 2.8e+20) {
tmp = x * (1.0 - (a * b));
} else {
tmp = -(x * (y * t));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.7e+29) tmp = Float64(t * fma(x, Float64(-y), Float64(x / t))); elseif (y <= 2.8e+20) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(-Float64(x * Float64(y * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.7e+29], N[(t * N[(x * (-y) + N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+20], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.7 \cdot 10^{+29}:\\
\;\;\;\;t \cdot \mathsf{fma}\left(x, -y, \frac{x}{t}\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+20}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-x \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if y < -4.7000000000000002e29Initial program 93.4%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6449.5
Simplified49.5%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6415.2
Simplified15.2%
Taylor expanded in t around inf
remove-double-negN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-out--N/A
mul-1-negN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
distribute-lft-out--N/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6423.3
Simplified23.3%
if -4.7000000000000002e29 < y < 2.8e20Initial program 99.3%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6479.8
Simplified79.8%
Taylor expanded in a around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6445.4
Simplified45.4%
if 2.8e20 < y Initial program 96.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6469.5
Simplified69.5%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6421.5
Simplified21.5%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6432.9
Simplified32.9%
Final simplification37.4%
(FPCore (x y z t a b) :precision binary64 (if (<= b -6.2e+112) (* x (- 1.0 (* a b))) (if (<= b 4.8e+85) (* x (- 1.0 (* y t))) (- x (* a (* x b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.2e+112) {
tmp = x * (1.0 - (a * b));
} else if (b <= 4.8e+85) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x - (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 (b <= (-6.2d+112)) then
tmp = x * (1.0d0 - (a * b))
else if (b <= 4.8d+85) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x - (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 (b <= -6.2e+112) {
tmp = x * (1.0 - (a * b));
} else if (b <= 4.8e+85) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x - (a * (x * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -6.2e+112: tmp = x * (1.0 - (a * b)) elif b <= 4.8e+85: tmp = x * (1.0 - (y * t)) else: tmp = x - (a * (x * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -6.2e+112) tmp = Float64(x * Float64(1.0 - Float64(a * b))); elseif (b <= 4.8e+85) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x - Float64(a * Float64(x * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -6.2e+112) tmp = x * (1.0 - (a * b)); elseif (b <= 4.8e+85) tmp = x * (1.0 - (y * t)); else tmp = x - (a * (x * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -6.2e+112], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.8e+85], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.2 \cdot 10^{+112}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;b \leq 4.8 \cdot 10^{+85}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if b < -6.19999999999999965e112Initial program 97.8%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6487.4
Simplified87.4%
Taylor expanded in a around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6437.4
Simplified37.4%
if -6.19999999999999965e112 < b < 4.79999999999999993e85Initial program 97.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6466.9
Simplified66.9%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6436.9
Simplified36.9%
if 4.79999999999999993e85 < b Initial program 95.6%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6480.6
Simplified80.6%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6431.2
Simplified31.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (- 1.0 (* a b))))) (if (<= b -1e+110) t_1 (if (<= b 5e+85) (* x (- 1.0 (* y t))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (1.0 - (a * b));
double tmp;
if (b <= -1e+110) {
tmp = t_1;
} else if (b <= 5e+85) {
tmp = x * (1.0 - (y * t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - (a * b))
if (b <= (-1d+110)) then
tmp = t_1
else if (b <= 5d+85) then
tmp = x * (1.0d0 - (y * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (1.0 - (a * b));
double tmp;
if (b <= -1e+110) {
tmp = t_1;
} else if (b <= 5e+85) {
tmp = x * (1.0 - (y * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (1.0 - (a * b)) tmp = 0 if b <= -1e+110: tmp = t_1 elif b <= 5e+85: tmp = x * (1.0 - (y * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(1.0 - Float64(a * b))) tmp = 0.0 if (b <= -1e+110) tmp = t_1; elseif (b <= 5e+85) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (1.0 - (a * b)); tmp = 0.0; if (b <= -1e+110) tmp = t_1; elseif (b <= 5e+85) tmp = x * (1.0 - (y * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1e+110], t$95$1, If[LessEqual[b, 5e+85], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - a \cdot b\right)\\
\mathbf{if}\;b \leq -1 \cdot 10^{+110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5 \cdot 10^{+85}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1e110 or 5.0000000000000001e85 < b Initial program 96.7%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6484.0
Simplified84.0%
Taylor expanded in a around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6434.3
Simplified34.3%
if -1e110 < b < 5.0000000000000001e85Initial program 97.6%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6466.9
Simplified66.9%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6436.9
Simplified36.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (- (* x (* y t))))) (if (<= y -6.1e+29) t_1 (if (<= y 2.8e+20) (* x (- 1.0 (* a b))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -(x * (y * t));
double tmp;
if (y <= -6.1e+29) {
tmp = t_1;
} else if (y <= 2.8e+20) {
tmp = x * (1.0 - (a * b));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = -(x * (y * t))
if (y <= (-6.1d+29)) then
tmp = t_1
else if (y <= 2.8d+20) then
tmp = x * (1.0d0 - (a * b))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -(x * (y * t));
double tmp;
if (y <= -6.1e+29) {
tmp = t_1;
} else if (y <= 2.8e+20) {
tmp = x * (1.0 - (a * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -(x * (y * t)) tmp = 0 if y <= -6.1e+29: tmp = t_1 elif y <= 2.8e+20: tmp = x * (1.0 - (a * b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(-Float64(x * Float64(y * t))) tmp = 0.0 if (y <= -6.1e+29) tmp = t_1; elseif (y <= 2.8e+20) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -(x * (y * t)); tmp = 0.0; if (y <= -6.1e+29) tmp = t_1; elseif (y <= 2.8e+20) tmp = x * (1.0 - (a * b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = (-N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[y, -6.1e+29], t$95$1, If[LessEqual[y, 2.8e+20], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -x \cdot \left(y \cdot t\right)\\
\mathbf{if}\;y \leq -6.1 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+20}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.0999999999999998e29 or 2.8e20 < y Initial program 95.0%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6459.3
Simplified59.3%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6418.3
Simplified18.3%
Taylor expanded in t around inf
mul-1-negN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6423.9
Simplified23.9%
if -6.0999999999999998e29 < y < 2.8e20Initial program 99.3%
Taylor expanded in b around inf
mul-1-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6479.8
Simplified79.8%
Taylor expanded in a around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6445.4
Simplified45.4%
Final simplification35.5%
(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}
Initial program 97.3%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
log-lowering-log.f6470.4
Simplified70.4%
Taylor expanded in y around 0
Simplified18.8%
herbie shell --seed 2024198
(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))))))