
(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 15 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 a (- (log1p (- z)) b) (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(a, (log1p(-z) - b), (y * (log(z) - t))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(a, Float64(log1p(Float64(-z)) - b), Float64(y * Float64(log(z) - t))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision] + N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(a, \mathsf{log1p}\left(-z\right) - b, y \cdot \left(\log z - t\right)\right)}
\end{array}
Initial program 95.4%
+-commutative95.4%
fma-def95.8%
sub-neg95.8%
log1p-def99.6%
Simplified99.6%
Final simplification99.6%
(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 95.4%
Final simplification95.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -28000000000000.0) (not (<= y 1e+20))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- (- z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -28000000000000.0) || !(y <= 1e+20)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * (-z - b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-28000000000000.0d0)) .or. (.not. (y <= 1d+20))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((a * (-z - b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -28000000000000.0) || !(y <= 1e+20)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (-z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -28000000000000.0) or not (y <= 1e+20): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (-z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -28000000000000.0) || !(y <= 1e+20)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -28000000000000.0) || ~((y <= 1e+20))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * (-z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -28000000000000.0], N[Not[LessEqual[y, 1e+20]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -28000000000000 \lor \neg \left(y \leq 10^{+20}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if y < -2.8e13 or 1e20 < y Initial program 97.6%
Taylor expanded in y around inf 88.8%
if -2.8e13 < y < 1e20Initial program 93.4%
Taylor expanded in y around 0 79.8%
sub-neg79.8%
mul-1-neg79.8%
log1p-def88.5%
mul-1-neg88.5%
Simplified88.5%
Taylor expanded in z around 0 88.5%
+-commutative88.5%
associate-*r*88.5%
associate-*r*88.5%
distribute-lft-out88.5%
mul-1-neg88.5%
Simplified88.5%
Final simplification88.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -14000000000000.0) (not (<= y 7e+19))) (* x (pow z y)) (* x (exp (* a (- (- z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -14000000000000.0) || !(y <= 7e+19)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((a * (-z - b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-14000000000000.0d0)) .or. (.not. (y <= 7d+19))) then
tmp = x * (z ** y)
else
tmp = x * exp((a * (-z - b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -14000000000000.0) || !(y <= 7e+19)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * (-z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -14000000000000.0) or not (y <= 7e+19): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * (-z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -14000000000000.0) || !(y <= 7e+19)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -14000000000000.0) || ~((y <= 7e+19))) tmp = x * (z ^ y); else tmp = x * exp((a * (-z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -14000000000000.0], N[Not[LessEqual[y, 7e+19]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -14000000000000 \lor \neg \left(y \leq 7 \cdot 10^{+19}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if y < -1.4e13 or 7e19 < y Initial program 97.6%
Taylor expanded in y around inf 88.8%
Taylor expanded in t around 0 74.4%
if -1.4e13 < y < 7e19Initial program 93.4%
Taylor expanded in y around 0 79.8%
sub-neg79.8%
mul-1-neg79.8%
log1p-def88.5%
mul-1-neg88.5%
Simplified88.5%
Taylor expanded in z around 0 88.5%
+-commutative88.5%
associate-*r*88.5%
associate-*r*88.5%
distribute-lft-out88.5%
mul-1-neg88.5%
Simplified88.5%
Final simplification81.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -19000000000000.0) (not (<= y 0.038))) (* x (pow z y)) (* x (exp (* b (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -19000000000000.0) || !(y <= 0.038)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((b * -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 <= (-19000000000000.0d0)) .or. (.not. (y <= 0.038d0))) then
tmp = x * (z ** y)
else
tmp = x * exp((b * -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 <= -19000000000000.0) || !(y <= 0.038)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((b * -a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -19000000000000.0) or not (y <= 0.038): tmp = x * math.pow(z, y) else: tmp = x * math.exp((b * -a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -19000000000000.0) || !(y <= 0.038)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(b * Float64(-a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -19000000000000.0) || ~((y <= 0.038))) tmp = x * (z ^ y); else tmp = x * exp((b * -a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -19000000000000.0], N[Not[LessEqual[y, 0.038]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(b * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -19000000000000 \lor \neg \left(y \leq 0.038\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{b \cdot \left(-a\right)}\\
\end{array}
\end{array}
if y < -1.9e13 or 0.0379999999999999991 < y Initial program 96.9%
Taylor expanded in y around inf 87.5%
Taylor expanded in t around 0 74.2%
if -1.9e13 < y < 0.0379999999999999991Initial program 94.0%
Taylor expanded in b around inf 80.7%
associate-*r*80.7%
neg-mul-180.7%
*-commutative80.7%
Simplified80.7%
Final simplification77.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.1e+169) (* x (- 1.0 (* y t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.1e+169) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.1d+169)) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.1e+169) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.1e+169: tmp = x * (1.0 - (y * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.1e+169) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.1e+169) tmp = x * (1.0 - (y * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.1e+169], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+169}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -2.1000000000000001e169Initial program 100.0%
Taylor expanded in t around inf 89.8%
mul-1-neg89.8%
distribute-rgt-neg-out89.8%
Simplified89.8%
Taylor expanded in y around 0 25.9%
+-commutative25.9%
mul-1-neg25.9%
unsub-neg25.9%
associate-*r*35.1%
*-commutative35.1%
Simplified35.1%
Taylor expanded in x around 0 35.1%
if -2.1000000000000001e169 < t Initial program 94.8%
Taylor expanded in y around inf 67.5%
Taylor expanded in t around 0 59.9%
Final simplification57.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.05e-73) (* t (* x (- y))) (if (<= y 0.00086) (* x (- 1.0 (* a b))) (* y (* x (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.05e-73) {
tmp = t * (x * -y);
} else if (y <= 0.00086) {
tmp = x * (1.0 - (a * b));
} else {
tmp = y * (x * -t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.05d-73)) then
tmp = t * (x * -y)
else if (y <= 0.00086d0) then
tmp = x * (1.0d0 - (a * b))
else
tmp = y * (x * -t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.05e-73) {
tmp = t * (x * -y);
} else if (y <= 0.00086) {
tmp = x * (1.0 - (a * b));
} else {
tmp = y * (x * -t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.05e-73: tmp = t * (x * -y) elif y <= 0.00086: tmp = x * (1.0 - (a * b)) else: tmp = y * (x * -t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.05e-73) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 0.00086) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(y * Float64(x * Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.05e-73) tmp = t * (x * -y); elseif (y <= 0.00086) tmp = x * (1.0 - (a * b)); else tmp = y * (x * -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.05e-73], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00086], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-73}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 0.00086:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\
\end{array}
\end{array}
if y < -1.0499999999999999e-73Initial program 95.2%
Taylor expanded in t around inf 56.7%
mul-1-neg56.7%
distribute-rgt-neg-out56.7%
Simplified56.7%
Taylor expanded in y around 0 16.3%
+-commutative16.3%
mul-1-neg16.3%
unsub-neg16.3%
associate-*r*17.5%
*-commutative17.5%
Simplified17.5%
Taylor expanded in y around inf 17.3%
expm1-log1p-u10.4%
expm1-udef17.4%
*-commutative17.4%
associate-*l*19.7%
Applied egg-rr19.7%
expm1-def12.8%
expm1-log1p19.6%
Simplified19.6%
if -1.0499999999999999e-73 < y < 8.59999999999999979e-4Initial program 95.7%
Taylor expanded in b around inf 85.6%
associate-*r*85.6%
neg-mul-185.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in b around 0 46.0%
+-commutative46.0%
mul-1-neg46.0%
unsub-neg46.0%
Simplified46.0%
Taylor expanded in x around 0 46.8%
if 8.59999999999999979e-4 < y Initial program 95.2%
Taylor expanded in t around inf 54.8%
mul-1-neg54.8%
distribute-rgt-neg-out54.8%
Simplified54.8%
Taylor expanded in y around 0 11.7%
+-commutative11.7%
mul-1-neg11.7%
unsub-neg11.7%
associate-*r*20.5%
*-commutative20.5%
Simplified20.5%
Taylor expanded in y around inf 28.2%
Final simplification33.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a -5.8e+141) (* x (- 1.0 (* a b))) (if (<= a 2.2e+133) (* x (- 1.0 (* y t))) (* a (- (* x b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.8e+141) {
tmp = x * (1.0 - (a * b));
} else if (a <= 2.2e+133) {
tmp = x * (1.0 - (y * t));
} else {
tmp = a * -(x * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-5.8d+141)) then
tmp = x * (1.0d0 - (a * b))
else if (a <= 2.2d+133) then
tmp = x * (1.0d0 - (y * t))
else
tmp = a * -(x * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.8e+141) {
tmp = x * (1.0 - (a * b));
} else if (a <= 2.2e+133) {
tmp = x * (1.0 - (y * t));
} else {
tmp = a * -(x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.8e+141: tmp = x * (1.0 - (a * b)) elif a <= 2.2e+133: tmp = x * (1.0 - (y * t)) else: tmp = a * -(x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.8e+141) tmp = Float64(x * Float64(1.0 - Float64(a * b))); elseif (a <= 2.2e+133) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(a * Float64(-Float64(x * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -5.8e+141) tmp = x * (1.0 - (a * b)); elseif (a <= 2.2e+133) tmp = x * (1.0 - (y * t)); else tmp = a * -(x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.8e+141], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.2e+133], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * (-N[(x * b), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{+141}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{+133}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(-x \cdot b\right)\\
\end{array}
\end{array}
if a < -5.80000000000000013e141Initial program 90.1%
Taylor expanded in b around inf 78.6%
associate-*r*78.6%
neg-mul-178.6%
*-commutative78.6%
Simplified78.6%
Taylor expanded in b around 0 30.0%
+-commutative30.0%
mul-1-neg30.0%
unsub-neg30.0%
Simplified30.0%
Taylor expanded in x around 0 36.3%
if -5.80000000000000013e141 < a < 2.2e133Initial program 99.5%
Taylor expanded in t around inf 64.9%
mul-1-neg64.9%
distribute-rgt-neg-out64.9%
Simplified64.9%
Taylor expanded in y around 0 31.1%
+-commutative31.1%
mul-1-neg31.1%
unsub-neg31.1%
associate-*r*34.3%
*-commutative34.3%
Simplified34.3%
Taylor expanded in x around 0 34.3%
if 2.2e133 < a Initial program 84.0%
Taylor expanded in b around inf 70.2%
associate-*r*70.2%
neg-mul-170.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in b around 0 20.8%
+-commutative20.8%
mul-1-neg20.8%
unsub-neg20.8%
Simplified20.8%
Taylor expanded in a around inf 30.5%
neg-mul-130.5%
distribute-rgt-neg-in30.5%
distribute-lft-neg-in30.5%
Simplified30.5%
Final simplification33.8%
(FPCore (x y z t a b) :precision binary64 (if (<= a -6.9e+19) (* x (- 1.0 (* a (+ z b)))) (if (<= a 5.2e+134) (* x (- 1.0 (* y t))) (* a (- (* x b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6.9e+19) {
tmp = x * (1.0 - (a * (z + b)));
} else if (a <= 5.2e+134) {
tmp = x * (1.0 - (y * t));
} else {
tmp = a * -(x * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-6.9d+19)) then
tmp = x * (1.0d0 - (a * (z + b)))
else if (a <= 5.2d+134) then
tmp = x * (1.0d0 - (y * t))
else
tmp = a * -(x * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6.9e+19) {
tmp = x * (1.0 - (a * (z + b)));
} else if (a <= 5.2e+134) {
tmp = x * (1.0 - (y * t));
} else {
tmp = a * -(x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6.9e+19: tmp = x * (1.0 - (a * (z + b))) elif a <= 5.2e+134: tmp = x * (1.0 - (y * t)) else: tmp = a * -(x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6.9e+19) tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b)))); elseif (a <= 5.2e+134) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(a * Float64(-Float64(x * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6.9e+19) tmp = x * (1.0 - (a * (z + b))); elseif (a <= 5.2e+134) tmp = x * (1.0 - (y * t)); else tmp = a * -(x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.9e+19], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2e+134], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * (-N[(x * b), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.9 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{+134}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(-x \cdot b\right)\\
\end{array}
\end{array}
if a < -6.9e19Initial program 94.8%
Taylor expanded in y around 0 66.7%
sub-neg66.7%
mul-1-neg66.7%
log1p-def80.2%
mul-1-neg80.2%
Simplified80.2%
Taylor expanded in z around 0 80.2%
+-commutative80.2%
associate-*r*80.2%
associate-*r*80.2%
distribute-lft-out80.2%
mul-1-neg80.2%
Simplified80.2%
Taylor expanded in a around 0 37.6%
associate-*r*37.6%
+-commutative37.6%
associate-*r*37.6%
neg-mul-137.6%
unsub-neg37.6%
+-commutative37.6%
Simplified37.6%
if -6.9e19 < a < 5.2000000000000003e134Initial program 99.4%
Taylor expanded in t around inf 66.4%
mul-1-neg66.4%
distribute-rgt-neg-out66.4%
Simplified66.4%
Taylor expanded in y around 0 31.0%
+-commutative31.0%
mul-1-neg31.0%
unsub-neg31.0%
associate-*r*34.7%
*-commutative34.7%
Simplified34.7%
Taylor expanded in x around 0 34.7%
if 5.2000000000000003e134 < a Initial program 84.0%
Taylor expanded in b around inf 70.2%
associate-*r*70.2%
neg-mul-170.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in b around 0 20.8%
+-commutative20.8%
mul-1-neg20.8%
unsub-neg20.8%
Simplified20.8%
Taylor expanded in a around inf 30.5%
neg-mul-130.5%
distribute-rgt-neg-in30.5%
distribute-lft-neg-in30.5%
Simplified30.5%
Final simplification34.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5e-97) (not (<= y 3.4e-8))) (* a (- (* x b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5e-97) || !(y <= 3.4e-8)) {
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 <= (-5d-97)) .or. (.not. (y <= 3.4d-8))) 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 <= -5e-97) || !(y <= 3.4e-8)) {
tmp = a * -(x * b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5e-97) or not (y <= 3.4e-8): tmp = a * -(x * b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5e-97) || !(y <= 3.4e-8)) tmp = Float64(a * Float64(-Float64(x * b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -5e-97) || ~((y <= 3.4e-8))) tmp = a * -(x * b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5e-97], N[Not[LessEqual[y, 3.4e-8]], $MachinePrecision]], N[(a * (-N[(x * b), $MachinePrecision])), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-97} \lor \neg \left(y \leq 3.4 \cdot 10^{-8}\right):\\
\;\;\;\;a \cdot \left(-x \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.9999999999999995e-97 or 3.4e-8 < y Initial program 94.8%
Taylor expanded in b around inf 37.1%
associate-*r*37.1%
neg-mul-137.1%
*-commutative37.1%
Simplified37.1%
Taylor expanded in b around 0 10.3%
+-commutative10.3%
mul-1-neg10.3%
unsub-neg10.3%
Simplified10.3%
Taylor expanded in a around inf 17.2%
neg-mul-117.2%
distribute-rgt-neg-in17.2%
distribute-lft-neg-in17.2%
Simplified17.2%
if -4.9999999999999995e-97 < y < 3.4e-8Initial program 96.3%
Taylor expanded in b around inf 86.2%
associate-*r*86.2%
neg-mul-186.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in b around 0 38.0%
Final simplification25.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.5e-112) (not (<= y 2.7e-13))) (* x (- (* y t))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.5e-112) || !(y <= 2.7e-13)) {
tmp = x * -(y * t);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-8.5d-112)) .or. (.not. (y <= 2.7d-13))) then
tmp = x * -(y * t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.5e-112) || !(y <= 2.7e-13)) {
tmp = x * -(y * t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.5e-112) or not (y <= 2.7e-13): tmp = x * -(y * t) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.5e-112) || !(y <= 2.7e-13)) tmp = Float64(x * Float64(-Float64(y * t))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -8.5e-112) || ~((y <= 2.7e-13))) tmp = x * -(y * t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.5e-112], N[Not[LessEqual[y, 2.7e-13]], $MachinePrecision]], N[(x * (-N[(y * t), $MachinePrecision])), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-112} \lor \neg \left(y \leq 2.7 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \left(-y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -8.49999999999999992e-112 or 2.70000000000000011e-13 < y Initial program 95.0%
Taylor expanded in t around inf 53.5%
mul-1-neg53.5%
distribute-rgt-neg-out53.5%
Simplified53.5%
Taylor expanded in y around 0 14.6%
+-commutative14.6%
mul-1-neg14.6%
unsub-neg14.6%
associate-*r*18.6%
*-commutative18.6%
Simplified18.6%
Taylor expanded in y around inf 22.7%
mul-1-neg22.7%
associate-*r*21.3%
*-commutative21.3%
distribute-rgt-neg-in21.3%
distribute-lft-neg-in21.3%
Simplified21.3%
if -8.49999999999999992e-112 < y < 2.70000000000000011e-13Initial program 96.1%
Taylor expanded in b around inf 85.4%
associate-*r*85.4%
neg-mul-185.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in b around 0 39.0%
Final simplification28.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -8.5e-112) (* t (* x (- y))) (if (<= y 1.06e-12) x (* x (- (* y t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8.5e-112) {
tmp = t * (x * -y);
} else if (y <= 1.06e-12) {
tmp = x;
} else {
tmp = x * -(y * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-8.5d-112)) then
tmp = t * (x * -y)
else if (y <= 1.06d-12) then
tmp = x
else
tmp = x * -(y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8.5e-112) {
tmp = t * (x * -y);
} else if (y <= 1.06e-12) {
tmp = x;
} else {
tmp = x * -(y * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -8.5e-112: tmp = t * (x * -y) elif y <= 1.06e-12: tmp = x else: tmp = x * -(y * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -8.5e-112) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 1.06e-12) tmp = x; else tmp = Float64(x * Float64(-Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -8.5e-112) tmp = t * (x * -y); elseif (y <= 1.06e-12) tmp = x; else tmp = x * -(y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8.5e-112], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e-12], x, N[(x * (-N[(y * t), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-112}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{-12}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-y \cdot t\right)\\
\end{array}
\end{array}
if y < -8.49999999999999992e-112Initial program 94.8%
Taylor expanded in t around inf 53.6%
mul-1-neg53.6%
distribute-rgt-neg-out53.6%
Simplified53.6%
Taylor expanded in y around 0 16.7%
+-commutative16.7%
mul-1-neg16.7%
unsub-neg16.7%
associate-*r*17.7%
*-commutative17.7%
Simplified17.7%
Taylor expanded in y around inf 18.5%
expm1-log1p-u12.6%
expm1-udef20.7%
*-commutative20.7%
associate-*l*22.6%
Applied egg-rr22.6%
expm1-def14.6%
expm1-log1p20.5%
Simplified20.5%
if -8.49999999999999992e-112 < y < 1.0599999999999999e-12Initial program 96.1%
Taylor expanded in b around inf 85.4%
associate-*r*85.4%
neg-mul-185.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in b around 0 39.0%
if 1.0599999999999999e-12 < y Initial program 95.3%
Taylor expanded in t around inf 53.2%
mul-1-neg53.2%
distribute-rgt-neg-out53.2%
Simplified53.2%
Taylor expanded in y around 0 11.4%
+-commutative11.4%
mul-1-neg11.4%
unsub-neg11.4%
associate-*r*19.9%
*-commutative19.9%
Simplified19.9%
Taylor expanded in y around inf 28.8%
mul-1-neg28.8%
associate-*r*25.3%
*-commutative25.3%
distribute-rgt-neg-in25.3%
distribute-lft-neg-in25.3%
Simplified25.3%
Final simplification28.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -7e-112) (* t (* x (- y))) (if (<= y 1.15e-12) x (* y (* x (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7e-112) {
tmp = t * (x * -y);
} else if (y <= 1.15e-12) {
tmp = x;
} else {
tmp = y * (x * -t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-7d-112)) then
tmp = t * (x * -y)
else if (y <= 1.15d-12) then
tmp = x
else
tmp = y * (x * -t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7e-112) {
tmp = t * (x * -y);
} else if (y <= 1.15e-12) {
tmp = x;
} else {
tmp = y * (x * -t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7e-112: tmp = t * (x * -y) elif y <= 1.15e-12: tmp = x else: tmp = y * (x * -t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7e-112) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 1.15e-12) tmp = x; else tmp = Float64(y * Float64(x * Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7e-112) tmp = t * (x * -y); elseif (y <= 1.15e-12) tmp = x; else tmp = y * (x * -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7e-112], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e-12], x, N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-112}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-12}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\
\end{array}
\end{array}
if y < -6.99999999999999988e-112Initial program 94.8%
Taylor expanded in t around inf 53.6%
mul-1-neg53.6%
distribute-rgt-neg-out53.6%
Simplified53.6%
Taylor expanded in y around 0 16.7%
+-commutative16.7%
mul-1-neg16.7%
unsub-neg16.7%
associate-*r*17.7%
*-commutative17.7%
Simplified17.7%
Taylor expanded in y around inf 18.5%
expm1-log1p-u12.6%
expm1-udef20.7%
*-commutative20.7%
associate-*l*22.6%
Applied egg-rr22.6%
expm1-def14.6%
expm1-log1p20.5%
Simplified20.5%
if -6.99999999999999988e-112 < y < 1.14999999999999995e-12Initial program 96.1%
Taylor expanded in b around inf 85.4%
associate-*r*85.4%
neg-mul-185.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in b around 0 39.0%
if 1.14999999999999995e-12 < y Initial program 95.3%
Taylor expanded in t around inf 53.2%
mul-1-neg53.2%
distribute-rgt-neg-out53.2%
Simplified53.2%
Taylor expanded in y around 0 11.4%
+-commutative11.4%
mul-1-neg11.4%
unsub-neg11.4%
associate-*r*19.9%
*-commutative19.9%
Simplified19.9%
Taylor expanded in y around inf 28.8%
Final simplification29.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y 0.0033) x (* a (* x b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 0.0033) {
tmp = x;
} else {
tmp = a * (x * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 0.0033d0) then
tmp = x
else
tmp = a * (x * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 0.0033) {
tmp = x;
} else {
tmp = a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 0.0033: tmp = x else: tmp = a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 0.0033) tmp = x; else tmp = Float64(a * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 0.0033) tmp = x; else tmp = a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 0.0033], x, N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.0033:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < 0.0033Initial program 95.5%
Taylor expanded in b around inf 64.9%
associate-*r*64.9%
neg-mul-164.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in b around 0 23.0%
if 0.0033 < y Initial program 95.1%
Taylor expanded in b around inf 32.0%
associate-*r*32.0%
neg-mul-132.0%
*-commutative32.0%
Simplified32.0%
Taylor expanded in b around 0 6.5%
+-commutative6.5%
mul-1-neg6.5%
unsub-neg6.5%
Simplified6.5%
Taylor expanded in a around inf 20.4%
neg-mul-120.4%
distribute-rgt-neg-in20.4%
distribute-lft-neg-in20.4%
Simplified20.4%
expm1-log1p-u19.8%
expm1-udef44.8%
add-sqr-sqrt14.9%
sqrt-unprod43.1%
sqr-neg43.1%
sqrt-unprod28.2%
add-sqr-sqrt41.7%
*-commutative41.7%
Applied egg-rr41.7%
expm1-def16.7%
expm1-log1p18.7%
Simplified18.7%
Final simplification21.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 95.4%
Taylor expanded in b around inf 57.0%
associate-*r*57.0%
neg-mul-157.0%
*-commutative57.0%
Simplified57.0%
Taylor expanded in b around 0 18.4%
Final simplification18.4%
herbie shell --seed 2023268
(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))))))