
(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 14 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 97.0%
+-commutative97.0%
fma-def97.3%
sub-neg97.3%
log1p-def100.0%
Simplified100.0%
Final simplification100.0%
(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.0%
Final simplification97.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -33000000000.0) (not (<= y 2.05e-110))) (* 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 <= -33000000000.0) || !(y <= 2.05e-110)) {
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 <= (-33000000000.0d0)) .or. (.not. (y <= 2.05d-110))) 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 <= -33000000000.0) || !(y <= 2.05e-110)) {
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 <= -33000000000.0) or not (y <= 2.05e-110): 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 <= -33000000000.0) || !(y <= 2.05e-110)) 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 <= -33000000000.0) || ~((y <= 2.05e-110))) 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, -33000000000.0], N[Not[LessEqual[y, 2.05e-110]], $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 -33000000000 \lor \neg \left(y \leq 2.05 \cdot 10^{-110}\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 < -3.3e10 or 2.04999999999999991e-110 < y Initial program 98.2%
Taylor expanded in y around inf 87.3%
if -3.3e10 < y < 2.04999999999999991e-110Initial program 94.9%
Taylor expanded in y around 0 88.1%
sub-neg88.1%
neg-mul-188.1%
log1p-def93.1%
neg-mul-193.1%
Simplified93.1%
Taylor expanded in z around 0 93.1%
+-commutative93.1%
associate-*r*93.1%
associate-*r*93.1%
distribute-lft-out93.1%
neg-mul-193.1%
Simplified93.1%
Final simplification89.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))) (t_2 (* x (exp (* y (- t))))))
(if (<= y -7e+88)
t_2
(if (<= y -1.75e+16)
t_1
(if (<= y -0.035) t_2 (if (<= y 2.0) (* 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 t_2 = x * exp((y * -t));
double tmp;
if (y <= -7e+88) {
tmp = t_2;
} else if (y <= -1.75e+16) {
tmp = t_1;
} else if (y <= -0.035) {
tmp = t_2;
} else if (y <= 2.0) {
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) :: t_2
real(8) :: tmp
t_1 = x * (z ** y)
t_2 = x * exp((y * -t))
if (y <= (-7d+88)) then
tmp = t_2
else if (y <= (-1.75d+16)) then
tmp = t_1
else if (y <= (-0.035d0)) then
tmp = t_2
else if (y <= 2.0d0) 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 t_2 = x * Math.exp((y * -t));
double tmp;
if (y <= -7e+88) {
tmp = t_2;
} else if (y <= -1.75e+16) {
tmp = t_1;
} else if (y <= -0.035) {
tmp = t_2;
} else if (y <= 2.0) {
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) t_2 = x * math.exp((y * -t)) tmp = 0 if y <= -7e+88: tmp = t_2 elif y <= -1.75e+16: tmp = t_1 elif y <= -0.035: tmp = t_2 elif y <= 2.0: 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)) t_2 = Float64(x * exp(Float64(y * Float64(-t)))) tmp = 0.0 if (y <= -7e+88) tmp = t_2; elseif (y <= -1.75e+16) tmp = t_1; elseif (y <= -0.035) tmp = t_2; elseif (y <= 2.0) 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); t_2 = x * exp((y * -t)); tmp = 0.0; if (y <= -7e+88) tmp = t_2; elseif (y <= -1.75e+16) tmp = t_1; elseif (y <= -0.035) tmp = t_2; elseif (y <= 2.0) 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]}, Block[{t$95$2 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+88], t$95$2, If[LessEqual[y, -1.75e+16], t$95$1, If[LessEqual[y, -0.035], t$95$2, If[LessEqual[y, 2.0], 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}\\
t_2 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;y \leq -7 \cdot 10^{+88}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -0.035:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -6.9999999999999995e88 or -1.75e16 < y < -0.035000000000000003Initial program 96.6%
Taylor expanded in t around inf 75.2%
mul-1-neg75.2%
distribute-rgt-neg-out75.2%
Simplified75.2%
if -6.9999999999999995e88 < y < -1.75e16 or 2 < y Initial program 98.9%
Taylor expanded in y around inf 86.9%
Taylor expanded in t around 0 68.3%
if -0.035000000000000003 < y < 2Initial program 95.5%
Taylor expanded in b around inf 83.0%
mul-1-neg83.0%
*-commutative83.0%
distribute-rgt-neg-in83.0%
Simplified83.0%
Final simplification76.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (- t))))))
(if (<= t -6800000.0)
t_1
(if (<= t -4.6e-160)
(* x (pow z y))
(if (<= t 1.15e+33) (* 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 <= -6800000.0) {
tmp = t_1;
} else if (t <= -4.6e-160) {
tmp = x * pow(z, y);
} else if (t <= 1.15e+33) {
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 <= (-6800000.0d0)) then
tmp = t_1
else if (t <= (-4.6d-160)) then
tmp = x * (z ** y)
else if (t <= 1.15d+33) 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 <= -6800000.0) {
tmp = t_1;
} else if (t <= -4.6e-160) {
tmp = x * Math.pow(z, y);
} else if (t <= 1.15e+33) {
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 <= -6800000.0: tmp = t_1 elif t <= -4.6e-160: tmp = x * math.pow(z, y) elif t <= 1.15e+33: 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(y * Float64(-t)))) tmp = 0.0 if (t <= -6800000.0) tmp = t_1; elseif (t <= -4.6e-160) tmp = Float64(x * (z ^ y)); elseif (t <= 1.15e+33) 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 <= -6800000.0) tmp = t_1; elseif (t <= -4.6e-160) tmp = x * (z ^ y); elseif (t <= 1.15e+33) 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, -6800000.0], t$95$1, If[LessEqual[t, -4.6e-160], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e+33], 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 \left(-t\right)}\\
\mathbf{if}\;t \leq -6800000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.6 \cdot 10^{-160}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+33}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -6.8e6 or 1.15000000000000005e33 < t Initial program 97.8%
Taylor expanded in t around inf 80.0%
mul-1-neg80.0%
distribute-rgt-neg-out80.0%
Simplified80.0%
if -6.8e6 < t < -4.5999999999999997e-160Initial program 97.1%
Taylor expanded in y around inf 72.5%
Taylor expanded in t around 0 72.5%
if -4.5999999999999997e-160 < t < 1.15000000000000005e33Initial program 95.6%
Taylor expanded in y around 0 68.4%
sub-neg68.4%
neg-mul-168.4%
log1p-def75.1%
neg-mul-175.1%
Simplified75.1%
Taylor expanded in z around 0 75.1%
+-commutative75.1%
associate-*r*75.1%
associate-*r*75.1%
distribute-lft-out75.1%
neg-mul-175.1%
Simplified75.1%
Final simplification77.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -26000000000.0)
(* x (- 1.0 (* y t)))
(if (or (<= t -1.5e-218) (not (<= t -2.7e-268)))
(* x (pow z y))
(* y (* x (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -26000000000.0) {
tmp = x * (1.0 - (y * t));
} else if ((t <= -1.5e-218) || !(t <= -2.7e-268)) {
tmp = x * pow(z, y);
} 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 (t <= (-26000000000.0d0)) then
tmp = x * (1.0d0 - (y * t))
else if ((t <= (-1.5d-218)) .or. (.not. (t <= (-2.7d-268)))) then
tmp = x * (z ** y)
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 (t <= -26000000000.0) {
tmp = x * (1.0 - (y * t));
} else if ((t <= -1.5e-218) || !(t <= -2.7e-268)) {
tmp = x * Math.pow(z, y);
} else {
tmp = y * (x * -t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -26000000000.0: tmp = x * (1.0 - (y * t)) elif (t <= -1.5e-218) or not (t <= -2.7e-268): tmp = x * math.pow(z, y) else: tmp = y * (x * -t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -26000000000.0) tmp = Float64(x * Float64(1.0 - Float64(y * t))); elseif ((t <= -1.5e-218) || !(t <= -2.7e-268)) tmp = Float64(x * (z ^ y)); 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 (t <= -26000000000.0) tmp = x * (1.0 - (y * t)); elseif ((t <= -1.5e-218) || ~((t <= -2.7e-268))) tmp = x * (z ^ y); else tmp = y * (x * -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -26000000000.0], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.5e-218], N[Not[LessEqual[t, -2.7e-268]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -26000000000:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{-218} \lor \neg \left(t \leq -2.7 \cdot 10^{-268}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\
\end{array}
\end{array}
if t < -2.6e10Initial program 96.0%
Taylor expanded in t around inf 77.6%
mul-1-neg77.6%
distribute-rgt-neg-out77.6%
Simplified77.6%
Taylor expanded in y around 0 25.0%
+-commutative25.0%
mul-1-neg25.0%
unsub-neg25.0%
Simplified25.0%
Taylor expanded in x around 0 30.2%
if -2.6e10 < t < -1.4999999999999999e-218 or -2.7000000000000001e-268 < t Initial program 97.7%
Taylor expanded in y around inf 71.0%
Taylor expanded in t around 0 65.3%
if -1.4999999999999999e-218 < t < -2.7000000000000001e-268Initial program 88.1%
Taylor expanded in t around inf 5.8%
mul-1-neg5.8%
distribute-rgt-neg-out5.8%
Simplified5.8%
Taylor expanded in y around 0 6.0%
+-commutative6.0%
mul-1-neg6.0%
unsub-neg6.0%
Simplified6.0%
Taylor expanded in y around inf 86.1%
neg-mul-186.1%
distribute-rgt-neg-in86.1%
distribute-rgt-neg-in86.1%
Simplified86.1%
Final simplification55.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -450000000000.0) (not (<= y 2.2))) (* 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 <= -450000000000.0) || !(y <= 2.2)) {
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 <= (-450000000000.0d0)) .or. (.not. (y <= 2.2d0))) 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 <= -450000000000.0) || !(y <= 2.2)) {
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 <= -450000000000.0) or not (y <= 2.2): 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 <= -450000000000.0) || !(y <= 2.2)) 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 <= -450000000000.0) || ~((y <= 2.2))) 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, -450000000000.0], N[Not[LessEqual[y, 2.2]], $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 -450000000000 \lor \neg \left(y \leq 2.2\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -4.5e11 or 2.2000000000000002 < y Initial program 98.0%
Taylor expanded in y around inf 88.5%
Taylor expanded in t around 0 62.9%
if -4.5e11 < y < 2.2000000000000002Initial program 95.6%
Taylor expanded in b around inf 81.7%
mul-1-neg81.7%
*-commutative81.7%
distribute-rgt-neg-in81.7%
Simplified81.7%
Final simplification71.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= z 1.1e-271)
x
(if (or (<= z 9.5e-194) (not (<= z 9.5e-58)))
(* y (* x (- t)))
(* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.1e-271) {
tmp = x;
} else if ((z <= 9.5e-194) || !(z <= 9.5e-58)) {
tmp = y * (x * -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 (z <= 1.1d-271) then
tmp = x
else if ((z <= 9.5d-194) .or. (.not. (z <= 9.5d-58))) then
tmp = y * (x * -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 (z <= 1.1e-271) {
tmp = x;
} else if ((z <= 9.5e-194) || !(z <= 9.5e-58)) {
tmp = y * (x * -t);
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= 1.1e-271: tmp = x elif (z <= 9.5e-194) or not (z <= 9.5e-58): tmp = y * (x * -t) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.1e-271) tmp = x; elseif ((z <= 9.5e-194) || !(z <= 9.5e-58)) tmp = Float64(y * Float64(x * Float64(-t))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= 1.1e-271) tmp = x; elseif ((z <= 9.5e-194) || ~((z <= 9.5e-58))) tmp = y * (x * -t); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.1e-271], x, If[Or[LessEqual[z, 9.5e-194], N[Not[LessEqual[z, 9.5e-58]], $MachinePrecision]], N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.1 \cdot 10^{-271}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-194} \lor \neg \left(z \leq 9.5 \cdot 10^{-58}\right):\\
\;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if z < 1.1e-271Initial program 97.2%
Taylor expanded in b around inf 54.4%
mul-1-neg54.4%
*-commutative54.4%
distribute-rgt-neg-in54.4%
Simplified54.4%
Taylor expanded in b around 0 32.0%
if 1.1e-271 < z < 9.50000000000000009e-194 or 9.4999999999999994e-58 < z Initial program 95.8%
Taylor expanded in t around inf 57.8%
mul-1-neg57.8%
distribute-rgt-neg-out57.8%
Simplified57.8%
Taylor expanded in y around 0 26.9%
+-commutative26.9%
mul-1-neg26.9%
unsub-neg26.9%
Simplified26.9%
Taylor expanded in y around inf 26.7%
neg-mul-126.7%
distribute-rgt-neg-in26.7%
distribute-rgt-neg-in26.7%
Simplified26.7%
if 9.50000000000000009e-194 < z < 9.4999999999999994e-58Initial program 98.1%
Taylor expanded in b around inf 56.9%
mul-1-neg56.9%
*-commutative56.9%
distribute-rgt-neg-in56.9%
Simplified56.9%
Taylor expanded in b around 0 25.2%
+-commutative25.2%
mul-1-neg25.2%
unsub-neg25.2%
Simplified25.2%
Taylor expanded in a around inf 30.1%
neg-mul-130.1%
distribute-rgt-neg-in30.1%
distribute-lft-neg-in30.1%
Simplified30.1%
Final simplification28.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (* x (- t)))))
(if (<= y -7.2e+37)
t_1
(if (<= y 0.031)
(* x (- 1.0 (* a b)))
(if (<= y 6.4e+153) (* a (* x (- b))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (x * -t);
double tmp;
if (y <= -7.2e+37) {
tmp = t_1;
} else if (y <= 0.031) {
tmp = x * (1.0 - (a * b));
} else if (y <= 6.4e+153) {
tmp = a * (x * -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 = y * (x * -t)
if (y <= (-7.2d+37)) then
tmp = t_1
else if (y <= 0.031d0) then
tmp = x * (1.0d0 - (a * b))
else if (y <= 6.4d+153) then
tmp = a * (x * -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 = y * (x * -t);
double tmp;
if (y <= -7.2e+37) {
tmp = t_1;
} else if (y <= 0.031) {
tmp = x * (1.0 - (a * b));
} else if (y <= 6.4e+153) {
tmp = a * (x * -b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * (x * -t) tmp = 0 if y <= -7.2e+37: tmp = t_1 elif y <= 0.031: tmp = x * (1.0 - (a * b)) elif y <= 6.4e+153: tmp = a * (x * -b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(x * Float64(-t))) tmp = 0.0 if (y <= -7.2e+37) tmp = t_1; elseif (y <= 0.031) tmp = Float64(x * Float64(1.0 - Float64(a * b))); elseif (y <= 6.4e+153) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * (x * -t); tmp = 0.0; if (y <= -7.2e+37) tmp = t_1; elseif (y <= 0.031) tmp = x * (1.0 - (a * b)); elseif (y <= 6.4e+153) tmp = a * (x * -b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e+37], t$95$1, If[LessEqual[y, 0.031], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e+153], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot \left(-t\right)\right)\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{+37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 0.031:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+153}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -7.19999999999999995e37 or 6.4000000000000003e153 < y Initial program 97.9%
Taylor expanded in t around inf 67.3%
mul-1-neg67.3%
distribute-rgt-neg-out67.3%
Simplified67.3%
Taylor expanded in y around 0 19.2%
+-commutative19.2%
mul-1-neg19.2%
unsub-neg19.2%
Simplified19.2%
Taylor expanded in y around inf 24.0%
neg-mul-124.0%
distribute-rgt-neg-in24.0%
distribute-rgt-neg-in24.0%
Simplified24.0%
if -7.19999999999999995e37 < y < 0.031Initial program 95.7%
Taylor expanded in b around inf 79.4%
mul-1-neg79.4%
*-commutative79.4%
distribute-rgt-neg-in79.4%
Simplified79.4%
Taylor expanded in b around 0 39.6%
+-commutative39.6%
mul-1-neg39.6%
unsub-neg39.6%
Simplified39.6%
Taylor expanded in x around 0 41.2%
if 0.031 < y < 6.4000000000000003e153Initial program 98.0%
Taylor expanded in b around inf 38.7%
mul-1-neg38.7%
*-commutative38.7%
distribute-rgt-neg-in38.7%
Simplified38.7%
Taylor expanded in b around 0 15.0%
+-commutative15.0%
mul-1-neg15.0%
unsub-neg15.0%
Simplified15.0%
Taylor expanded in a around inf 30.8%
neg-mul-130.8%
distribute-rgt-neg-in30.8%
distribute-lft-neg-in30.8%
Simplified30.8%
Final simplification32.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.8e+46) (not (<= b 2.8e-14))) (* x (- 1.0 (* a b))) (* x (- 1.0 (* y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.8e+46) || !(b <= 2.8e-14)) {
tmp = x * (1.0 - (a * b));
} 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) :: tmp
if ((b <= (-1.8d+46)) .or. (.not. (b <= 2.8d-14))) then
tmp = x * (1.0d0 - (a * b))
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 tmp;
if ((b <= -1.8e+46) || !(b <= 2.8e-14)) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.8e+46) or not (b <= 2.8e-14): tmp = x * (1.0 - (a * b)) else: tmp = x * (1.0 - (y * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.8e+46) || !(b <= 2.8e-14)) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x * Float64(1.0 - Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.8e+46) || ~((b <= 2.8e-14))) tmp = x * (1.0 - (a * b)); else tmp = x * (1.0 - (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.8e+46], N[Not[LessEqual[b, 2.8e-14]], $MachinePrecision]], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{+46} \lor \neg \left(b \leq 2.8 \cdot 10^{-14}\right):\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\end{array}
\end{array}
if b < -1.7999999999999999e46 or 2.8000000000000001e-14 < b Initial program 99.2%
Taylor expanded in b around inf 74.0%
mul-1-neg74.0%
*-commutative74.0%
distribute-rgt-neg-in74.0%
Simplified74.0%
Taylor expanded in b around 0 25.3%
+-commutative25.3%
mul-1-neg25.3%
unsub-neg25.3%
Simplified25.3%
Taylor expanded in x around 0 25.4%
if -1.7999999999999999e46 < b < 2.8000000000000001e-14Initial program 95.0%
Taylor expanded in t around inf 68.5%
mul-1-neg68.5%
distribute-rgt-neg-out68.5%
Simplified68.5%
Taylor expanded in y around 0 32.9%
+-commutative32.9%
mul-1-neg32.9%
unsub-neg32.9%
Simplified32.9%
Taylor expanded in x around 0 37.8%
Final simplification32.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.7e+43) (not (<= b 8.6e-19))) (* x (- 1.0 (* a b))) (- x (* x (* y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.7e+43) || !(b <= 8.6e-19)) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x - (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 ((b <= (-1.7d+43)) .or. (.not. (b <= 8.6d-19))) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x - (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 ((b <= -1.7e+43) || !(b <= 8.6e-19)) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x - (x * (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.7e+43) or not (b <= 8.6e-19): tmp = x * (1.0 - (a * b)) else: tmp = x - (x * (y * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.7e+43) || !(b <= 8.6e-19)) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x - Float64(x * Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.7e+43) || ~((b <= 8.6e-19))) tmp = x * (1.0 - (a * b)); else tmp = x - (x * (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.7e+43], N[Not[LessEqual[b, 8.6e-19]], $MachinePrecision]], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{+43} \lor \neg \left(b \leq 8.6 \cdot 10^{-19}\right):\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if b < -1.70000000000000006e43 or 8.6e-19 < b Initial program 99.2%
Taylor expanded in b around inf 74.0%
mul-1-neg74.0%
*-commutative74.0%
distribute-rgt-neg-in74.0%
Simplified74.0%
Taylor expanded in b around 0 25.3%
+-commutative25.3%
mul-1-neg25.3%
unsub-neg25.3%
Simplified25.3%
Taylor expanded in x around 0 25.4%
if -1.70000000000000006e43 < b < 8.6e-19Initial program 95.0%
Taylor expanded in y around inf 87.3%
Taylor expanded in y around 0 37.2%
Taylor expanded in t around inf 32.9%
mul-1-neg32.9%
associate-*r*37.8%
distribute-lft-neg-in37.8%
distribute-rgt-neg-out37.8%
*-commutative37.8%
neg-mul-137.8%
associate-*r*37.8%
*-commutative37.8%
mul-1-neg37.8%
Simplified37.8%
Final simplification32.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.9e-15) (not (<= y 5.8e-212))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.9e-15) || !(y <= 5.8e-212)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.9d-15)) .or. (.not. (y <= 5.8d-212))) then
tmp = a * (x * -b)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.9e-15) || !(y <= 5.8e-212)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.9e-15) or not (y <= 5.8e-212): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.9e-15) || !(y <= 5.8e-212)) 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 <= -1.9e-15) || ~((y <= 5.8e-212))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.9e-15], N[Not[LessEqual[y, 5.8e-212]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-15} \lor \neg \left(y \leq 5.8 \cdot 10^{-212}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.9000000000000001e-15 or 5.7999999999999999e-212 < y Initial program 97.8%
Taylor expanded in b around inf 41.4%
mul-1-neg41.4%
*-commutative41.4%
distribute-rgt-neg-in41.4%
Simplified41.4%
Taylor expanded in b around 0 15.3%
+-commutative15.3%
mul-1-neg15.3%
unsub-neg15.3%
Simplified15.3%
Taylor expanded in a around inf 22.1%
neg-mul-122.1%
distribute-rgt-neg-in22.1%
distribute-lft-neg-in22.1%
Simplified22.1%
if -1.9000000000000001e-15 < y < 5.7999999999999999e-212Initial program 94.8%
Taylor expanded in b around inf 86.2%
mul-1-neg86.2%
*-commutative86.2%
distribute-rgt-neg-in86.2%
Simplified86.2%
Taylor expanded in b around 0 37.0%
Final simplification26.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.8) x (* a (* x b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.8) {
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 <= 2.8d0) 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 <= 2.8) {
tmp = x;
} else {
tmp = a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.8: tmp = x else: tmp = a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.8) 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 <= 2.8) tmp = x; else tmp = a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.8], x, N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.8:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < 2.7999999999999998Initial program 96.2%
Taylor expanded in b around inf 62.6%
mul-1-neg62.6%
*-commutative62.6%
distribute-rgt-neg-in62.6%
Simplified62.6%
Taylor expanded in b around 0 19.9%
if 2.7999999999999998 < y Initial program 98.7%
Taylor expanded in b around inf 35.6%
mul-1-neg35.6%
*-commutative35.6%
distribute-rgt-neg-in35.6%
Simplified35.6%
Taylor expanded in b around 0 13.4%
+-commutative13.4%
mul-1-neg13.4%
unsub-neg13.4%
Simplified13.4%
Taylor expanded in a around inf 28.0%
neg-mul-128.0%
distribute-rgt-neg-in28.0%
distribute-lft-neg-in28.0%
Simplified28.0%
expm1-log1p-u21.3%
expm1-udef45.6%
add-sqr-sqrt26.0%
sqrt-unprod41.7%
sqr-neg41.7%
sqrt-unprod18.3%
add-sqr-sqrt41.6%
Applied egg-rr41.6%
expm1-def17.3%
expm1-log1p17.6%
Simplified17.6%
Final simplification19.2%
(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.0%
Taylor expanded in b around inf 54.4%
mul-1-neg54.4%
*-commutative54.4%
distribute-rgt-neg-in54.4%
Simplified54.4%
Taylor expanded in b around 0 15.1%
Final simplification15.1%
herbie shell --seed 2023196
(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))))))