
(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 (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}
Initial program 96.5%
fma-define96.5%
sub-neg96.5%
log1p-define98.8%
Simplified98.8%
Final simplification98.8%
(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 96.5%
Final simplification96.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (- t))))))
(if (<= t -7e+183)
t_1
(if (<= t -1e+109)
(* x (exp (* a (- (- b) z))))
(if (or (<= t -7400000000000.0) (not (<= t 2.15e+176)))
t_1
(* x (exp (- (* y (log z)) (* a b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((y * -t));
double tmp;
if (t <= -7e+183) {
tmp = t_1;
} else if (t <= -1e+109) {
tmp = x * exp((a * (-b - z)));
} else if ((t <= -7400000000000.0) || !(t <= 2.15e+176)) {
tmp = t_1;
} else {
tmp = x * exp(((y * log(z)) - (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * exp((y * -t))
if (t <= (-7d+183)) then
tmp = t_1
else if (t <= (-1d+109)) then
tmp = x * exp((a * (-b - z)))
else if ((t <= (-7400000000000.0d0)) .or. (.not. (t <= 2.15d+176))) then
tmp = t_1
else
tmp = x * exp(((y * log(z)) - (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp((y * -t));
double tmp;
if (t <= -7e+183) {
tmp = t_1;
} else if (t <= -1e+109) {
tmp = x * Math.exp((a * (-b - z)));
} else if ((t <= -7400000000000.0) || !(t <= 2.15e+176)) {
tmp = t_1;
} else {
tmp = x * Math.exp(((y * Math.log(z)) - (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((y * -t)) tmp = 0 if t <= -7e+183: tmp = t_1 elif t <= -1e+109: tmp = x * math.exp((a * (-b - z))) elif (t <= -7400000000000.0) or not (t <= 2.15e+176): tmp = t_1 else: tmp = x * math.exp(((y * math.log(z)) - (a * b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(y * Float64(-t)))) tmp = 0.0 if (t <= -7e+183) tmp = t_1; elseif (t <= -1e+109) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); elseif ((t <= -7400000000000.0) || !(t <= 2.15e+176)) tmp = t_1; else tmp = Float64(x * exp(Float64(Float64(y * log(z)) - Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((y * -t)); tmp = 0.0; if (t <= -7e+183) tmp = t_1; elseif (t <= -1e+109) tmp = x * exp((a * (-b - z))); elseif ((t <= -7400000000000.0) || ~((t <= 2.15e+176))) tmp = t_1; else tmp = x * exp(((y * log(z)) - (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7e+183], t$95$1, If[LessEqual[t, -1e+109], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -7400000000000.0], N[Not[LessEqual[t, 2.15e+176]], $MachinePrecision]], t$95$1, N[(x * N[Exp[N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;t \leq -7 \cdot 10^{+183}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1 \cdot 10^{+109}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{elif}\;t \leq -7400000000000 \lor \neg \left(t \leq 2.15 \cdot 10^{+176}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\
\end{array}
\end{array}
if t < -6.99999999999999974e183 or -9.99999999999999982e108 < t < -7.4e12 or 2.15000000000000013e176 < t Initial program 94.1%
Taylor expanded in t around inf 89.8%
mul-1-neg89.8%
distribute-lft-neg-out89.8%
*-commutative89.8%
Simplified89.8%
if -6.99999999999999974e183 < t < -9.99999999999999982e108Initial program 100.0%
Taylor expanded in y around 0 77.4%
sub-neg77.4%
log1p-define85.0%
Simplified85.0%
Taylor expanded in z around 0 85.0%
+-commutative85.0%
associate-*r*85.0%
associate-*r*85.0%
distribute-lft-out85.0%
mul-1-neg85.0%
Simplified85.0%
if -7.4e12 < t < 2.15000000000000013e176Initial program 97.2%
Taylor expanded in z around 0 96.6%
Taylor expanded in z around inf 96.6%
+-commutative96.6%
fma-define96.6%
mul-1-neg96.6%
log-rec96.6%
remove-double-neg96.6%
mul-1-neg96.6%
fma-neg96.6%
Simplified96.6%
Taylor expanded in t around 0 93.9%
Final simplification92.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.46) (not (<= y 2.95e-83))) (* x (pow (/ z (exp t)) y)) (* x (exp (* a (- (- b) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.46) || !(y <= 2.95e-83)) {
tmp = x * pow((z / exp(t)), y);
} else {
tmp = x * exp((a * (-b - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-0.46d0)) .or. (.not. (y <= 2.95d-83))) then
tmp = x * ((z / exp(t)) ** y)
else
tmp = x * exp((a * (-b - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.46) || !(y <= 2.95e-83)) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else {
tmp = x * Math.exp((a * (-b - z)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -0.46) or not (y <= 2.95e-83): tmp = x * math.pow((z / math.exp(t)), y) else: tmp = x * math.exp((a * (-b - z))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -0.46) || !(y <= 2.95e-83)) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -0.46) || ~((y <= 2.95e-83))) tmp = x * ((z / exp(t)) ^ y); else tmp = x * exp((a * (-b - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -0.46], N[Not[LessEqual[y, 2.95e-83]], $MachinePrecision]], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.46 \lor \neg \left(y \leq 2.95 \cdot 10^{-83}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\end{array}
\end{array}
if y < -0.46000000000000002 or 2.9499999999999998e-83 < y Initial program 96.4%
Taylor expanded in a around 0 87.9%
*-commutative87.9%
exp-prod86.5%
exp-diff86.5%
rem-exp-log86.5%
Simplified86.5%
if -0.46000000000000002 < y < 2.9499999999999998e-83Initial program 96.7%
Taylor expanded in y around 0 85.2%
sub-neg85.2%
log1p-define89.3%
Simplified89.3%
Taylor expanded in z around 0 89.3%
+-commutative89.3%
associate-*r*89.3%
associate-*r*89.3%
distribute-lft-out89.3%
mul-1-neg89.3%
Simplified89.3%
Final simplification87.8%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * b)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) - (a * b)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) - (a * b)));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * b)))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * b))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b}
\end{array}
Initial program 96.5%
Taylor expanded in z around 0 95.7%
Taylor expanded in z around inf 95.7%
+-commutative95.7%
fma-define95.8%
mul-1-neg95.8%
log-rec95.8%
remove-double-neg95.8%
mul-1-neg95.8%
fma-neg95.7%
Simplified95.7%
Final simplification95.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* a (- (- b) z))))) (t_2 (* x (exp (* y (- t))))))
(if (<= t -7e+183)
t_2
(if (<= t -2.9e-260)
t_1
(if (<= t 8.8e-213) (* x (pow z y)) (if (<= t 6.8e-35) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((a * (-b - z)));
double t_2 = x * exp((y * -t));
double tmp;
if (t <= -7e+183) {
tmp = t_2;
} else if (t <= -2.9e-260) {
tmp = t_1;
} else if (t <= 8.8e-213) {
tmp = x * pow(z, y);
} else if (t <= 6.8e-35) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * exp((a * (-b - z)))
t_2 = x * exp((y * -t))
if (t <= (-7d+183)) then
tmp = t_2
else if (t <= (-2.9d-260)) then
tmp = t_1
else if (t <= 8.8d-213) then
tmp = x * (z ** y)
else if (t <= 6.8d-35) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp((a * (-b - z)));
double t_2 = x * Math.exp((y * -t));
double tmp;
if (t <= -7e+183) {
tmp = t_2;
} else if (t <= -2.9e-260) {
tmp = t_1;
} else if (t <= 8.8e-213) {
tmp = x * Math.pow(z, y);
} else if (t <= 6.8e-35) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((a * (-b - z))) t_2 = x * math.exp((y * -t)) tmp = 0 if t <= -7e+183: tmp = t_2 elif t <= -2.9e-260: tmp = t_1 elif t <= 8.8e-213: tmp = x * math.pow(z, y) elif t <= 6.8e-35: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))) t_2 = Float64(x * exp(Float64(y * Float64(-t)))) tmp = 0.0 if (t <= -7e+183) tmp = t_2; elseif (t <= -2.9e-260) tmp = t_1; elseif (t <= 8.8e-213) tmp = Float64(x * (z ^ y)); elseif (t <= 6.8e-35) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((a * (-b - z))); t_2 = x * exp((y * -t)); tmp = 0.0; if (t <= -7e+183) tmp = t_2; elseif (t <= -2.9e-260) tmp = t_1; elseif (t <= 8.8e-213) tmp = x * (z ^ y); elseif (t <= 6.8e-35) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7e+183], t$95$2, If[LessEqual[t, -2.9e-260], t$95$1, If[LessEqual[t, 8.8e-213], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e-35], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
t_2 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;t \leq -7 \cdot 10^{+183}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.9 \cdot 10^{-260}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-213}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -6.99999999999999974e183 or 6.8000000000000005e-35 < t Initial program 97.0%
Taylor expanded in t around inf 88.4%
mul-1-neg88.4%
distribute-lft-neg-out88.4%
*-commutative88.4%
Simplified88.4%
if -6.99999999999999974e183 < t < -2.8999999999999999e-260 or 8.80000000000000039e-213 < t < 6.8000000000000005e-35Initial program 95.3%
Taylor expanded in y around 0 75.7%
sub-neg75.7%
log1p-define81.1%
Simplified81.1%
Taylor expanded in z around 0 81.1%
+-commutative81.1%
associate-*r*81.1%
associate-*r*81.1%
distribute-lft-out81.1%
mul-1-neg81.1%
Simplified81.1%
if -2.8999999999999999e-260 < t < 8.80000000000000039e-213Initial program 100.0%
Taylor expanded in a around 0 87.0%
*-commutative87.0%
exp-prod87.0%
exp-diff87.0%
rem-exp-log87.0%
Simplified87.0%
Taylor expanded in t around 0 87.0%
Final simplification84.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -1.2)
t_1
(if (<= y 1.06e-88)
(* x (exp (* a (- b))))
(if (<= y 0.037) (* x (exp (* y (- t)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * pow(z, y);
double tmp;
if (y <= -1.2) {
tmp = t_1;
} else if (y <= 1.06e-88) {
tmp = x * exp((a * -b));
} else if (y <= 0.037) {
tmp = x * exp((y * -t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (y <= (-1.2d0)) then
tmp = t_1
else if (y <= 1.06d-88) then
tmp = x * exp((a * -b))
else if (y <= 0.037d0) then
tmp = x * exp((y * -t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.pow(z, y);
double tmp;
if (y <= -1.2) {
tmp = t_1;
} else if (y <= 1.06e-88) {
tmp = x * Math.exp((a * -b));
} else if (y <= 0.037) {
tmp = x * Math.exp((y * -t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -1.2: tmp = t_1 elif y <= 1.06e-88: tmp = x * math.exp((a * -b)) elif y <= 0.037: tmp = x * math.exp((y * -t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -1.2) tmp = t_1; elseif (y <= 1.06e-88) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif (y <= 0.037) tmp = Float64(x * exp(Float64(y * Float64(-t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -1.2) tmp = t_1; elseif (y <= 1.06e-88) tmp = x * exp((a * -b)); elseif (y <= 0.037) tmp = x * exp((y * -t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.2], t$95$1, If[LessEqual[y, 1.06e-88], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.037], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -1.2:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{-88}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq 0.037:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.19999999999999996 or 0.0369999999999999982 < y Initial program 97.4%
Taylor expanded in a around 0 90.6%
*-commutative90.6%
exp-prod90.6%
exp-diff90.6%
rem-exp-log90.6%
Simplified90.6%
Taylor expanded in t around 0 76.0%
if -1.19999999999999996 < y < 1.06e-88Initial program 96.6%
Taylor expanded in b around inf 84.3%
mul-1-neg84.3%
distribute-rgt-neg-out84.3%
Simplified84.3%
if 1.06e-88 < y < 0.0369999999999999982Initial program 91.3%
Taylor expanded in t around inf 74.4%
mul-1-neg74.4%
distribute-lft-neg-out74.4%
*-commutative74.4%
Simplified74.4%
Final simplification79.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.5) (not (<= y 1.8))) (* x (pow z y)) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.5) || !(y <= 1.8)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((a * -b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6.5d0)) .or. (.not. (y <= 1.8d0))) then
tmp = x * (z ** y)
else
tmp = x * exp((a * -b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.5) || !(y <= 1.8)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.5) or not (y <= 1.8): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.5) || !(y <= 1.8)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.5) || ~((y <= 1.8))) tmp = x * (z ^ y); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.5], N[Not[LessEqual[y, 1.8]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \lor \neg \left(y \leq 1.8\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -6.5 or 1.80000000000000004 < y Initial program 97.4%
Taylor expanded in a around 0 90.6%
*-commutative90.6%
exp-prod90.6%
exp-diff90.6%
rem-exp-log90.6%
Simplified90.6%
Taylor expanded in t around 0 76.0%
if -6.5 < y < 1.80000000000000004Initial program 95.8%
Taylor expanded in b around inf 78.5%
mul-1-neg78.5%
distribute-rgt-neg-out78.5%
Simplified78.5%
Final simplification77.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.5e+45) (* b (* a (- (/ x (* a b)) x))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.5e+45) {
tmp = b * (a * ((x / (a * b)) - x));
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.5d+45)) then
tmp = b * (a * ((x / (a * b)) - x))
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.5e+45) {
tmp = b * (a * ((x / (a * b)) - x));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.5e+45: tmp = b * (a * ((x / (a * b)) - x)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.5e+45) tmp = Float64(b * Float64(a * Float64(Float64(x / Float64(a * b)) - x))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.5e+45) tmp = b * (a * ((x / (a * b)) - x)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.5e+45], N[(b * N[(a * N[(N[(x / N[(a * b), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+45}:\\
\;\;\;\;b \cdot \left(a \cdot \left(\frac{x}{a \cdot b} - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -2.5e45Initial program 96.2%
Taylor expanded in b around inf 46.2%
mul-1-neg46.2%
distribute-rgt-neg-out46.2%
Simplified46.2%
Taylor expanded in a around 0 22.2%
+-commutative22.2%
associate-*r*22.2%
neg-mul-122.2%
Simplified22.2%
Taylor expanded in b around inf 24.5%
+-commutative24.5%
mul-1-neg24.5%
unsub-neg24.5%
Simplified24.5%
Taylor expanded in a around inf 35.4%
if -2.5e45 < t Initial program 96.6%
Taylor expanded in a around 0 73.2%
*-commutative73.2%
exp-prod67.0%
exp-diff67.0%
rem-exp-log67.0%
Simplified67.0%
Taylor expanded in t around 0 66.1%
Final simplification59.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (/ x b))))
(if (<= y -0.24)
t_1
(if (<= y 1.1e-210) x (if (<= y 4e-7) t_1 (- (* z (* x a))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (x / b);
double tmp;
if (y <= -0.24) {
tmp = t_1;
} else if (y <= 1.1e-210) {
tmp = x;
} else if (y <= 4e-7) {
tmp = t_1;
} else {
tmp = -(z * (x * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (x / b)
if (y <= (-0.24d0)) then
tmp = t_1
else if (y <= 1.1d-210) then
tmp = x
else if (y <= 4d-7) then
tmp = t_1
else
tmp = -(z * (x * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (x / b);
double tmp;
if (y <= -0.24) {
tmp = t_1;
} else if (y <= 1.1e-210) {
tmp = x;
} else if (y <= 4e-7) {
tmp = t_1;
} else {
tmp = -(z * (x * a));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (x / b) tmp = 0 if y <= -0.24: tmp = t_1 elif y <= 1.1e-210: tmp = x elif y <= 4e-7: tmp = t_1 else: tmp = -(z * (x * a)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(x / b)) tmp = 0.0 if (y <= -0.24) tmp = t_1; elseif (y <= 1.1e-210) tmp = x; elseif (y <= 4e-7) tmp = t_1; else tmp = Float64(-Float64(z * Float64(x * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (x / b); tmp = 0.0; if (y <= -0.24) tmp = t_1; elseif (y <= 1.1e-210) tmp = x; elseif (y <= 4e-7) tmp = t_1; else tmp = -(z * (x * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(x / b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.24], t$95$1, If[LessEqual[y, 1.1e-210], x, If[LessEqual[y, 4e-7], t$95$1, (-N[(z * N[(x * a), $MachinePrecision]), $MachinePrecision])]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \frac{x}{b}\\
\mathbf{if}\;y \leq -0.24:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-210}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-z \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if y < -0.23999999999999999 or 1.09999999999999995e-210 < y < 3.9999999999999998e-7Initial program 97.3%
Taylor expanded in b around inf 50.7%
mul-1-neg50.7%
distribute-rgt-neg-out50.7%
Simplified50.7%
Taylor expanded in a around 0 25.4%
+-commutative25.4%
associate-*r*25.4%
neg-mul-125.4%
Simplified25.4%
Taylor expanded in b around inf 30.4%
+-commutative30.4%
mul-1-neg30.4%
unsub-neg30.4%
Simplified30.4%
Taylor expanded in b around 0 23.5%
if -0.23999999999999999 < y < 1.09999999999999995e-210Initial program 95.6%
Taylor expanded in a around 0 54.8%
*-commutative54.8%
exp-prod44.3%
exp-diff44.3%
rem-exp-log44.3%
Simplified44.3%
Taylor expanded in y around 0 43.9%
if 3.9999999999999998e-7 < y Initial program 96.6%
Taylor expanded in y around 0 36.3%
sub-neg36.3%
log1p-define41.2%
Simplified41.2%
Taylor expanded in b around 0 5.6%
Taylor expanded in z around 0 3.5%
mul-1-neg3.5%
unsub-neg3.5%
associate-*r*3.4%
*-commutative3.4%
associate-*l*3.5%
Simplified3.5%
Taylor expanded in a around inf 27.6%
associate-*r*24.4%
*-commutative24.4%
neg-mul-124.4%
distribute-rgt-neg-in24.4%
mul-1-neg24.4%
associate-*r*24.4%
mul-1-neg24.4%
Simplified24.4%
Final simplification31.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -0.26) (* b (* x (- (/ 1.0 b) a))) (if (<= y 8.2e-17) (* x (- 1.0 (* a b))) (* (- b) (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.26) {
tmp = b * (x * ((1.0 / b) - a));
} else if (y <= 8.2e-17) {
tmp = x * (1.0 - (a * b));
} else {
tmp = -b * (x * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-0.26d0)) then
tmp = b * (x * ((1.0d0 / b) - a))
else if (y <= 8.2d-17) then
tmp = x * (1.0d0 - (a * b))
else
tmp = -b * (x * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.26) {
tmp = b * (x * ((1.0 / b) - a));
} else if (y <= 8.2e-17) {
tmp = x * (1.0 - (a * b));
} else {
tmp = -b * (x * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -0.26: tmp = b * (x * ((1.0 / b) - a)) elif y <= 8.2e-17: tmp = x * (1.0 - (a * b)) else: tmp = -b * (x * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -0.26) tmp = Float64(b * Float64(x * Float64(Float64(1.0 / b) - a))); elseif (y <= 8.2e-17) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(Float64(-b) * Float64(x * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -0.26) tmp = b * (x * ((1.0 / b) - a)); elseif (y <= 8.2e-17) tmp = x * (1.0 - (a * b)); else tmp = -b * (x * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.26], N[(b * N[(x * N[(N[(1.0 / b), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-17], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.26:\\
\;\;\;\;b \cdot \left(x \cdot \left(\frac{1}{b} - a\right)\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-17}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if y < -0.26000000000000001Initial program 98.3%
Taylor expanded in b around inf 38.3%
mul-1-neg38.3%
distribute-rgt-neg-out38.3%
Simplified38.3%
Taylor expanded in a around 0 14.8%
+-commutative14.8%
associate-*r*14.8%
neg-mul-114.8%
Simplified14.8%
Taylor expanded in b around inf 26.1%
+-commutative26.1%
mul-1-neg26.1%
unsub-neg26.1%
Simplified26.1%
Taylor expanded in x around 0 26.1%
if -0.26000000000000001 < y < 8.2000000000000001e-17Initial program 96.3%
Taylor expanded in b around inf 80.5%
mul-1-neg80.5%
distribute-rgt-neg-out80.5%
Simplified80.5%
Taylor expanded in a around 0 49.4%
+-commutative49.4%
associate-*r*49.4%
neg-mul-149.4%
Simplified49.4%
Taylor expanded in x around 0 49.4%
neg-mul-149.4%
unsub-neg49.4%
Simplified49.4%
if 8.2000000000000001e-17 < y Initial program 95.3%
Taylor expanded in b around inf 34.7%
mul-1-neg34.7%
distribute-rgt-neg-out34.7%
Simplified34.7%
Taylor expanded in a around 0 12.6%
+-commutative12.6%
associate-*r*12.6%
neg-mul-112.6%
Simplified12.6%
Taylor expanded in a around inf 29.0%
*-commutative29.0%
associate-*r*29.0%
associate-*r*29.0%
associate-*l*29.0%
mul-1-neg29.0%
*-commutative29.0%
Simplified29.0%
Final simplification39.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -0.15) (* b (* a (- (/ x (* a b)) x))) (if (<= y 7.2e-17) (* x (- 1.0 (* a b))) (* (- b) (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.15) {
tmp = b * (a * ((x / (a * b)) - x));
} else if (y <= 7.2e-17) {
tmp = x * (1.0 - (a * b));
} else {
tmp = -b * (x * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-0.15d0)) then
tmp = b * (a * ((x / (a * b)) - x))
else if (y <= 7.2d-17) then
tmp = x * (1.0d0 - (a * b))
else
tmp = -b * (x * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.15) {
tmp = b * (a * ((x / (a * b)) - x));
} else if (y <= 7.2e-17) {
tmp = x * (1.0 - (a * b));
} else {
tmp = -b * (x * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -0.15: tmp = b * (a * ((x / (a * b)) - x)) elif y <= 7.2e-17: tmp = x * (1.0 - (a * b)) else: tmp = -b * (x * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -0.15) tmp = Float64(b * Float64(a * Float64(Float64(x / Float64(a * b)) - x))); elseif (y <= 7.2e-17) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(Float64(-b) * Float64(x * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -0.15) tmp = b * (a * ((x / (a * b)) - x)); elseif (y <= 7.2e-17) tmp = x * (1.0 - (a * b)); else tmp = -b * (x * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.15], N[(b * N[(a * N[(N[(x / N[(a * b), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e-17], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.15:\\
\;\;\;\;b \cdot \left(a \cdot \left(\frac{x}{a \cdot b} - x\right)\right)\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-17}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if y < -0.149999999999999994Initial program 98.3%
Taylor expanded in b around inf 38.3%
mul-1-neg38.3%
distribute-rgt-neg-out38.3%
Simplified38.3%
Taylor expanded in a around 0 14.8%
+-commutative14.8%
associate-*r*14.8%
neg-mul-114.8%
Simplified14.8%
Taylor expanded in b around inf 26.1%
+-commutative26.1%
mul-1-neg26.1%
unsub-neg26.1%
Simplified26.1%
Taylor expanded in a around inf 31.1%
if -0.149999999999999994 < y < 7.1999999999999999e-17Initial program 96.3%
Taylor expanded in b around inf 80.5%
mul-1-neg80.5%
distribute-rgt-neg-out80.5%
Simplified80.5%
Taylor expanded in a around 0 49.4%
+-commutative49.4%
associate-*r*49.4%
neg-mul-149.4%
Simplified49.4%
Taylor expanded in x around 0 49.4%
neg-mul-149.4%
unsub-neg49.4%
Simplified49.4%
if 7.1999999999999999e-17 < y Initial program 95.3%
Taylor expanded in b around inf 34.7%
mul-1-neg34.7%
distribute-rgt-neg-out34.7%
Simplified34.7%
Taylor expanded in a around 0 12.6%
+-commutative12.6%
associate-*r*12.6%
neg-mul-112.6%
Simplified12.6%
Taylor expanded in a around inf 29.0%
*-commutative29.0%
associate-*r*29.0%
associate-*r*29.0%
associate-*l*29.0%
mul-1-neg29.0%
*-commutative29.0%
Simplified29.0%
Final simplification40.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7800000000000.0) (not (<= y 2.6e-20))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7800000000000.0) || !(y <= 2.6e-20)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-7800000000000.0d0)) .or. (.not. (y <= 2.6d-20))) then
tmp = a * (x * -b)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7800000000000.0) || !(y <= 2.6e-20)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7800000000000.0) or not (y <= 2.6e-20): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7800000000000.0) || !(y <= 2.6e-20)) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7800000000000.0) || ~((y <= 2.6e-20))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7800000000000.0], N[Not[LessEqual[y, 2.6e-20]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7800000000000 \lor \neg \left(y \leq 2.6 \cdot 10^{-20}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -7.8e12 or 2.59999999999999995e-20 < y Initial program 96.6%
Taylor expanded in b around inf 38.8%
mul-1-neg38.8%
distribute-rgt-neg-out38.8%
Simplified38.8%
Taylor expanded in a around 0 14.9%
+-commutative14.9%
associate-*r*14.9%
neg-mul-114.9%
Simplified14.9%
Taylor expanded in a around inf 24.9%
associate-*r*24.9%
mul-1-neg24.9%
Simplified24.9%
if -7.8e12 < y < 2.59999999999999995e-20Initial program 96.4%
Taylor expanded in a around 0 61.4%
*-commutative61.4%
exp-prod51.8%
exp-diff51.8%
rem-exp-log51.8%
Simplified51.8%
Taylor expanded in y around 0 39.8%
Final simplification33.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6600000000000.0) (not (<= y 4.2e-24))) (* (- b) (* x a)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6600000000000.0) || !(y <= 4.2e-24)) {
tmp = -b * (x * a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6600000000000.0d0)) .or. (.not. (y <= 4.2d-24))) then
tmp = -b * (x * a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6600000000000.0) || !(y <= 4.2e-24)) {
tmp = -b * (x * a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6600000000000.0) or not (y <= 4.2e-24): tmp = -b * (x * a) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6600000000000.0) || !(y <= 4.2e-24)) tmp = Float64(Float64(-b) * Float64(x * a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6600000000000.0) || ~((y <= 4.2e-24))) tmp = -b * (x * a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6600000000000.0], N[Not[LessEqual[y, 4.2e-24]], $MachinePrecision]], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6600000000000 \lor \neg \left(y \leq 4.2 \cdot 10^{-24}\right):\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.6e12 or 4.1999999999999999e-24 < y Initial program 96.6%
Taylor expanded in b around inf 38.8%
mul-1-neg38.8%
distribute-rgt-neg-out38.8%
Simplified38.8%
Taylor expanded in a around 0 14.9%
+-commutative14.9%
associate-*r*14.9%
neg-mul-114.9%
Simplified14.9%
Taylor expanded in a around inf 24.9%
*-commutative24.9%
associate-*r*24.9%
associate-*r*24.9%
associate-*l*25.7%
mul-1-neg25.7%
*-commutative25.7%
Simplified25.7%
if -6.6e12 < y < 4.1999999999999999e-24Initial program 96.4%
Taylor expanded in a around 0 61.4%
*-commutative61.4%
exp-prod51.8%
exp-diff51.8%
rem-exp-log51.8%
Simplified51.8%
Taylor expanded in y around 0 39.8%
Final simplification33.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.2e-274) (not (<= b 8.2e-267))) (* b (/ x b)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.2e-274) || !(b <= 8.2e-267)) {
tmp = b * (x / b);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-5.2d-274)) .or. (.not. (b <= 8.2d-267))) then
tmp = b * (x / b)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.2e-274) || !(b <= 8.2e-267)) {
tmp = b * (x / b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.2e-274) or not (b <= 8.2e-267): tmp = b * (x / b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.2e-274) || !(b <= 8.2e-267)) tmp = Float64(b * Float64(x / b)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5.2e-274) || ~((b <= 8.2e-267))) tmp = b * (x / b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.2e-274], N[Not[LessEqual[b, 8.2e-267]], $MachinePrecision]], N[(b * N[(x / b), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.2 \cdot 10^{-274} \lor \neg \left(b \leq 8.2 \cdot 10^{-267}\right):\\
\;\;\;\;b \cdot \frac{x}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if b < -5.2e-274 or 8.20000000000000022e-267 < b Initial program 97.4%
Taylor expanded in b around inf 60.3%
mul-1-neg60.3%
distribute-rgt-neg-out60.3%
Simplified60.3%
Taylor expanded in a around 0 30.2%
+-commutative30.2%
associate-*r*30.2%
neg-mul-130.2%
Simplified30.2%
Taylor expanded in b around inf 32.6%
+-commutative32.6%
mul-1-neg32.6%
unsub-neg32.6%
Simplified32.6%
Taylor expanded in b around 0 26.3%
if -5.2e-274 < b < 8.20000000000000022e-267Initial program 89.6%
Taylor expanded in a around 0 86.1%
*-commutative86.1%
exp-prod72.7%
exp-diff72.7%
rem-exp-log72.7%
Simplified72.7%
Taylor expanded in y around 0 52.4%
Final simplification29.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y 6e-17) (* x (- 1.0 (* a b))) (* (- b) (* x a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6e-17) {
tmp = x * (1.0 - (a * b));
} else {
tmp = -b * (x * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 6d-17) then
tmp = x * (1.0d0 - (a * b))
else
tmp = -b * (x * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6e-17) {
tmp = x * (1.0 - (a * b));
} else {
tmp = -b * (x * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 6e-17: tmp = x * (1.0 - (a * b)) else: tmp = -b * (x * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 6e-17) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(Float64(-b) * Float64(x * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 6e-17) tmp = x * (1.0 - (a * b)); else tmp = -b * (x * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 6e-17], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{-17}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if y < 6.00000000000000012e-17Initial program 96.9%
Taylor expanded in b around inf 67.9%
mul-1-neg67.9%
distribute-rgt-neg-out67.9%
Simplified67.9%
Taylor expanded in a around 0 39.1%
+-commutative39.1%
associate-*r*39.1%
neg-mul-139.1%
Simplified39.1%
Taylor expanded in x around 0 39.1%
neg-mul-139.1%
unsub-neg39.1%
Simplified39.1%
if 6.00000000000000012e-17 < y Initial program 95.3%
Taylor expanded in b around inf 34.7%
mul-1-neg34.7%
distribute-rgt-neg-out34.7%
Simplified34.7%
Taylor expanded in a around 0 12.6%
+-commutative12.6%
associate-*r*12.6%
neg-mul-112.6%
Simplified12.6%
Taylor expanded in a around inf 29.0%
*-commutative29.0%
associate-*r*29.0%
associate-*r*29.0%
associate-*l*29.0%
mul-1-neg29.0%
*-commutative29.0%
Simplified29.0%
Final simplification36.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y 8.2e-17) x (* a (* x b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 8.2e-17) {
tmp = x;
} else {
tmp = a * (x * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 8.2d-17) then
tmp = x
else
tmp = a * (x * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 8.2e-17) {
tmp = x;
} else {
tmp = a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 8.2e-17: tmp = x else: tmp = a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 8.2e-17) tmp = x; else tmp = Float64(a * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 8.2e-17) tmp = x; else tmp = a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 8.2e-17], x, N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.2 \cdot 10^{-17}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < 8.2000000000000001e-17Initial program 96.9%
Taylor expanded in a around 0 68.9%
*-commutative68.9%
exp-prod62.0%
exp-diff62.0%
rem-exp-log62.0%
Simplified62.0%
Taylor expanded in y around 0 29.6%
if 8.2000000000000001e-17 < y Initial program 95.3%
Taylor expanded in b around inf 34.7%
mul-1-neg34.7%
distribute-rgt-neg-out34.7%
Simplified34.7%
Taylor expanded in a around 0 12.6%
+-commutative12.6%
associate-*r*12.6%
neg-mul-112.6%
Simplified12.6%
Taylor expanded in a around inf 29.0%
associate-*r*29.0%
mul-1-neg29.0%
Simplified29.0%
add-sqr-sqrt8.7%
sqrt-unprod34.8%
sqr-neg34.8%
sqrt-unprod15.3%
add-sqr-sqrt22.4%
pow122.4%
Applied egg-rr22.4%
unpow122.4%
Simplified22.4%
Final simplification27.9%
(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 96.5%
Taylor expanded in a around 0 73.8%
*-commutative73.8%
exp-prod68.5%
exp-diff68.5%
rem-exp-log68.5%
Simplified68.5%
Taylor expanded in y around 0 23.4%
Final simplification23.4%
herbie shell --seed 2024074
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
:precision binary64
(* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))