
(FPCore (x y z) :precision binary64 (exp (- (+ x (* y (log y))) z)))
double code(double x, double y, double z) {
return exp(((x + (y * log(y))) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = exp(((x + (y * log(y))) - z))
end function
public static double code(double x, double y, double z) {
return Math.exp(((x + (y * Math.log(y))) - z));
}
def code(x, y, z): return math.exp(((x + (y * math.log(y))) - z))
function code(x, y, z) return exp(Float64(Float64(x + Float64(y * log(y))) - z)) end
function tmp = code(x, y, z) tmp = exp(((x + (y * log(y))) - z)); end
code[x_, y_, z_] := N[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(x + y \cdot \log y\right) - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (exp (- (+ x (* y (log y))) z)))
double code(double x, double y, double z) {
return exp(((x + (y * log(y))) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = exp(((x + (y * log(y))) - z))
end function
public static double code(double x, double y, double z) {
return Math.exp(((x + (y * Math.log(y))) - z));
}
def code(x, y, z): return math.exp(((x + (y * math.log(y))) - z))
function code(x, y, z) return exp(Float64(Float64(x + Float64(y * log(y))) - z)) end
function tmp = code(x, y, z) tmp = exp(((x + (y * log(y))) - z)); end
code[x_, y_, z_] := N[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(x + y \cdot \log y\right) - z}
\end{array}
(FPCore (x y z) :precision binary64 (exp (- (+ x (* y (log y))) z)))
double code(double x, double y, double z) {
return exp(((x + (y * log(y))) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = exp(((x + (y * log(y))) - z))
end function
public static double code(double x, double y, double z) {
return Math.exp(((x + (y * Math.log(y))) - z));
}
def code(x, y, z): return math.exp(((x + (y * math.log(y))) - z))
function code(x, y, z) return exp(Float64(Float64(x + Float64(y * log(y))) - z)) end
function tmp = code(x, y, z) tmp = exp(((x + (y * log(y))) - z)); end
code[x_, y_, z_] := N[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(x + y \cdot \log y\right) - z}
\end{array}
Initial program 100.0%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* y (log y)))) (if (<= t_0 200.0) (* (pow y y) (exp (- x z))) (exp (- t_0 z)))))
double code(double x, double y, double z) {
double t_0 = y * log(y);
double tmp;
if (t_0 <= 200.0) {
tmp = pow(y, y) * exp((x - z));
} else {
tmp = exp((t_0 - z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y * log(y)
if (t_0 <= 200.0d0) then
tmp = (y ** y) * exp((x - z))
else
tmp = exp((t_0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * Math.log(y);
double tmp;
if (t_0 <= 200.0) {
tmp = Math.pow(y, y) * Math.exp((x - z));
} else {
tmp = Math.exp((t_0 - z));
}
return tmp;
}
def code(x, y, z): t_0 = y * math.log(y) tmp = 0 if t_0 <= 200.0: tmp = math.pow(y, y) * math.exp((x - z)) else: tmp = math.exp((t_0 - z)) return tmp
function code(x, y, z) t_0 = Float64(y * log(y)) tmp = 0.0 if (t_0 <= 200.0) tmp = Float64((y ^ y) * exp(Float64(x - z))); else tmp = exp(Float64(t_0 - z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * log(y); tmp = 0.0; if (t_0 <= 200.0) tmp = (y ^ y) * exp((x - z)); else tmp = exp((t_0 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 200.0], N[(N[Power[y, y], $MachinePrecision] * N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(t$95$0 - z), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \log y\\
\mathbf{if}\;t\_0 \leq 200:\\
\;\;\;\;{y}^{y} \cdot e^{x - z}\\
\mathbf{else}:\\
\;\;\;\;e^{t\_0 - z}\\
\end{array}
\end{array}
if (*.f64 y (log.f64 y)) < 200Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
exp-sum99.9%
*-commutative99.9%
exp-to-pow100.0%
Simplified100.0%
if 200 < (*.f64 y (log.f64 y)) Initial program 100.0%
Taylor expanded in x around 0 88.2%
(FPCore (x y z) :precision binary64 (if (<= x -1.8e+116) (exp x) (if (<= x 0.27) (exp (- (* y (log y)) z)) (* (pow y y) (exp x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.8e+116) {
tmp = exp(x);
} else if (x <= 0.27) {
tmp = exp(((y * log(y)) - z));
} else {
tmp = pow(y, y) * exp(x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.8d+116)) then
tmp = exp(x)
else if (x <= 0.27d0) then
tmp = exp(((y * log(y)) - z))
else
tmp = (y ** y) * exp(x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.8e+116) {
tmp = Math.exp(x);
} else if (x <= 0.27) {
tmp = Math.exp(((y * Math.log(y)) - z));
} else {
tmp = Math.pow(y, y) * Math.exp(x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.8e+116: tmp = math.exp(x) elif x <= 0.27: tmp = math.exp(((y * math.log(y)) - z)) else: tmp = math.pow(y, y) * math.exp(x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.8e+116) tmp = exp(x); elseif (x <= 0.27) tmp = exp(Float64(Float64(y * log(y)) - z)); else tmp = Float64((y ^ y) * exp(x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.8e+116) tmp = exp(x); elseif (x <= 0.27) tmp = exp(((y * log(y)) - z)); else tmp = (y ^ y) * exp(x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.8e+116], N[Exp[x], $MachinePrecision], If[LessEqual[x, 0.27], N[Exp[N[(N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision], N[(N[Power[y, y], $MachinePrecision] * N[Exp[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+116}:\\
\;\;\;\;e^{x}\\
\mathbf{elif}\;x \leq 0.27:\\
\;\;\;\;e^{y \cdot \log y - z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y} \cdot e^{x}\\
\end{array}
\end{array}
if x < -1.79999999999999985e116Initial program 100.0%
Taylor expanded in x around inf 80.8%
if -1.79999999999999985e116 < x < 0.27000000000000002Initial program 99.9%
Taylor expanded in x around 0 94.5%
if 0.27000000000000002 < x Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
exp-sum96.6%
*-commutative96.6%
exp-to-pow96.6%
Simplified96.6%
Taylor expanded in z around 0 96.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.05e+34) (not (<= z 1.2e+127))) (exp (- z)) (* (pow y y) (exp x))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.05e+34) || !(z <= 1.2e+127)) {
tmp = exp(-z);
} else {
tmp = pow(y, y) * exp(x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-2.05d+34)) .or. (.not. (z <= 1.2d+127))) then
tmp = exp(-z)
else
tmp = (y ** y) * exp(x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.05e+34) || !(z <= 1.2e+127)) {
tmp = Math.exp(-z);
} else {
tmp = Math.pow(y, y) * Math.exp(x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.05e+34) or not (z <= 1.2e+127): tmp = math.exp(-z) else: tmp = math.pow(y, y) * math.exp(x) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.05e+34) || !(z <= 1.2e+127)) tmp = exp(Float64(-z)); else tmp = Float64((y ^ y) * exp(x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.05e+34) || ~((z <= 1.2e+127))) tmp = exp(-z); else tmp = (y ^ y) * exp(x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.05e+34], N[Not[LessEqual[z, 1.2e+127]], $MachinePrecision]], N[Exp[(-z)], $MachinePrecision], N[(N[Power[y, y], $MachinePrecision] * N[Exp[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+34} \lor \neg \left(z \leq 1.2 \cdot 10^{+127}\right):\\
\;\;\;\;e^{-z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y} \cdot e^{x}\\
\end{array}
\end{array}
if z < -2.0499999999999999e34 or 1.2000000000000001e127 < z Initial program 100.0%
Taylor expanded in z around inf 84.3%
neg-mul-184.3%
Simplified84.3%
if -2.0499999999999999e34 < z < 1.2000000000000001e127Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
exp-sum76.2%
*-commutative76.2%
exp-to-pow76.3%
Simplified76.3%
Taylor expanded in z around 0 76.6%
Final simplification79.6%
(FPCore (x y z) :precision binary64 (if (<= x -9.5e+115) (exp x) (if (<= x 8.2e-176) (/ (pow y y) (exp z)) (* (pow y y) (exp x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -9.5e+115) {
tmp = exp(x);
} else if (x <= 8.2e-176) {
tmp = pow(y, y) / exp(z);
} else {
tmp = pow(y, y) * exp(x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-9.5d+115)) then
tmp = exp(x)
else if (x <= 8.2d-176) then
tmp = (y ** y) / exp(z)
else
tmp = (y ** y) * exp(x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -9.5e+115) {
tmp = Math.exp(x);
} else if (x <= 8.2e-176) {
tmp = Math.pow(y, y) / Math.exp(z);
} else {
tmp = Math.pow(y, y) * Math.exp(x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9.5e+115: tmp = math.exp(x) elif x <= 8.2e-176: tmp = math.pow(y, y) / math.exp(z) else: tmp = math.pow(y, y) * math.exp(x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9.5e+115) tmp = exp(x); elseif (x <= 8.2e-176) tmp = Float64((y ^ y) / exp(z)); else tmp = Float64((y ^ y) * exp(x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9.5e+115) tmp = exp(x); elseif (x <= 8.2e-176) tmp = (y ^ y) / exp(z); else tmp = (y ^ y) * exp(x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9.5e+115], N[Exp[x], $MachinePrecision], If[LessEqual[x, 8.2e-176], N[(N[Power[y, y], $MachinePrecision] / N[Exp[z], $MachinePrecision]), $MachinePrecision], N[(N[Power[y, y], $MachinePrecision] * N[Exp[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+115}:\\
\;\;\;\;e^{x}\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-176}:\\
\;\;\;\;\frac{{y}^{y}}{e^{z}}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y} \cdot e^{x}\\
\end{array}
\end{array}
if x < -9.4999999999999997e115Initial program 100.0%
Taylor expanded in x around inf 80.8%
if -9.4999999999999997e115 < x < 8.2000000000000005e-176Initial program 100.0%
Taylor expanded in x around 0 93.0%
exp-diff78.8%
*-commutative78.8%
exp-to-pow78.8%
Simplified78.8%
if 8.2000000000000005e-176 < x Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
exp-sum88.3%
*-commutative88.3%
exp-to-pow88.4%
Simplified88.4%
Taylor expanded in z around 0 89.7%
(FPCore (x y z)
:precision binary64
(if (<= x -1.05e+84)
(exp x)
(if (<= x -1.65e-97)
(* (pow y y) (+ 1.0 (* x (+ 1.0 (* x 0.5)))))
(if (<= x 1.28e-179) (exp (- z)) (if (<= x 1.4e-6) (pow y y) (exp x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.05e+84) {
tmp = exp(x);
} else if (x <= -1.65e-97) {
tmp = pow(y, y) * (1.0 + (x * (1.0 + (x * 0.5))));
} else if (x <= 1.28e-179) {
tmp = exp(-z);
} else if (x <= 1.4e-6) {
tmp = pow(y, y);
} else {
tmp = exp(x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.05d+84)) then
tmp = exp(x)
else if (x <= (-1.65d-97)) then
tmp = (y ** y) * (1.0d0 + (x * (1.0d0 + (x * 0.5d0))))
else if (x <= 1.28d-179) then
tmp = exp(-z)
else if (x <= 1.4d-6) then
tmp = y ** y
else
tmp = exp(x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.05e+84) {
tmp = Math.exp(x);
} else if (x <= -1.65e-97) {
tmp = Math.pow(y, y) * (1.0 + (x * (1.0 + (x * 0.5))));
} else if (x <= 1.28e-179) {
tmp = Math.exp(-z);
} else if (x <= 1.4e-6) {
tmp = Math.pow(y, y);
} else {
tmp = Math.exp(x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.05e+84: tmp = math.exp(x) elif x <= -1.65e-97: tmp = math.pow(y, y) * (1.0 + (x * (1.0 + (x * 0.5)))) elif x <= 1.28e-179: tmp = math.exp(-z) elif x <= 1.4e-6: tmp = math.pow(y, y) else: tmp = math.exp(x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.05e+84) tmp = exp(x); elseif (x <= -1.65e-97) tmp = Float64((y ^ y) * Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5))))); elseif (x <= 1.28e-179) tmp = exp(Float64(-z)); elseif (x <= 1.4e-6) tmp = y ^ y; else tmp = exp(x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.05e+84) tmp = exp(x); elseif (x <= -1.65e-97) tmp = (y ^ y) * (1.0 + (x * (1.0 + (x * 0.5)))); elseif (x <= 1.28e-179) tmp = exp(-z); elseif (x <= 1.4e-6) tmp = y ^ y; else tmp = exp(x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.05e+84], N[Exp[x], $MachinePrecision], If[LessEqual[x, -1.65e-97], N[(N[Power[y, y], $MachinePrecision] * N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.28e-179], N[Exp[(-z)], $MachinePrecision], If[LessEqual[x, 1.4e-6], N[Power[y, y], $MachinePrecision], N[Exp[x], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+84}:\\
\;\;\;\;e^{x}\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-97}:\\
\;\;\;\;{y}^{y} \cdot \left(1 + x \cdot \left(1 + x \cdot 0.5\right)\right)\\
\mathbf{elif}\;x \leq 1.28 \cdot 10^{-179}:\\
\;\;\;\;e^{-z}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-6}:\\
\;\;\;\;{y}^{y}\\
\mathbf{else}:\\
\;\;\;\;e^{x}\\
\end{array}
\end{array}
if x < -1.05000000000000009e84 or 1.39999999999999994e-6 < x Initial program 100.0%
Taylor expanded in x around inf 86.0%
if -1.05000000000000009e84 < x < -1.6500000000000001e-97Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
exp-sum69.7%
*-commutative69.7%
exp-to-pow69.7%
Simplified69.7%
Taylor expanded in z around 0 48.6%
Taylor expanded in x around 0 64.4%
if -1.6500000000000001e-97 < x < 1.28000000000000006e-179Initial program 100.0%
Taylor expanded in z around inf 80.8%
neg-mul-180.8%
Simplified80.8%
if 1.28000000000000006e-179 < x < 1.39999999999999994e-6Initial program 99.7%
Taylor expanded in x around 0 99.3%
Taylor expanded in z around 0 80.6%
Final simplification80.9%
(FPCore (x y z) :precision binary64 (if (<= x -8e+83) (exp x) (if (<= x 1.52e-179) (exp (- z)) (if (<= x 1.4e-6) (pow y y) (exp x)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -8e+83) {
tmp = exp(x);
} else if (x <= 1.52e-179) {
tmp = exp(-z);
} else if (x <= 1.4e-6) {
tmp = pow(y, y);
} else {
tmp = exp(x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-8d+83)) then
tmp = exp(x)
else if (x <= 1.52d-179) then
tmp = exp(-z)
else if (x <= 1.4d-6) then
tmp = y ** y
else
tmp = exp(x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -8e+83) {
tmp = Math.exp(x);
} else if (x <= 1.52e-179) {
tmp = Math.exp(-z);
} else if (x <= 1.4e-6) {
tmp = Math.pow(y, y);
} else {
tmp = Math.exp(x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -8e+83: tmp = math.exp(x) elif x <= 1.52e-179: tmp = math.exp(-z) elif x <= 1.4e-6: tmp = math.pow(y, y) else: tmp = math.exp(x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -8e+83) tmp = exp(x); elseif (x <= 1.52e-179) tmp = exp(Float64(-z)); elseif (x <= 1.4e-6) tmp = y ^ y; else tmp = exp(x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -8e+83) tmp = exp(x); elseif (x <= 1.52e-179) tmp = exp(-z); elseif (x <= 1.4e-6) tmp = y ^ y; else tmp = exp(x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -8e+83], N[Exp[x], $MachinePrecision], If[LessEqual[x, 1.52e-179], N[Exp[(-z)], $MachinePrecision], If[LessEqual[x, 1.4e-6], N[Power[y, y], $MachinePrecision], N[Exp[x], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{+83}:\\
\;\;\;\;e^{x}\\
\mathbf{elif}\;x \leq 1.52 \cdot 10^{-179}:\\
\;\;\;\;e^{-z}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-6}:\\
\;\;\;\;{y}^{y}\\
\mathbf{else}:\\
\;\;\;\;e^{x}\\
\end{array}
\end{array}
if x < -8.00000000000000025e83 or 1.39999999999999994e-6 < x Initial program 100.0%
Taylor expanded in x around inf 86.0%
if -8.00000000000000025e83 < x < 1.52e-179Initial program 100.0%
Taylor expanded in z around inf 72.0%
neg-mul-172.0%
Simplified72.0%
if 1.52e-179 < x < 1.39999999999999994e-6Initial program 99.7%
Taylor expanded in x around 0 99.3%
Taylor expanded in z around 0 80.6%
(FPCore (x y z) :precision binary64 (if (or (<= x -7.8e+83) (not (<= x 720.0))) (exp x) (exp (- z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -7.8e+83) || !(x <= 720.0)) {
tmp = exp(x);
} else {
tmp = exp(-z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-7.8d+83)) .or. (.not. (x <= 720.0d0))) then
tmp = exp(x)
else
tmp = exp(-z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -7.8e+83) || !(x <= 720.0)) {
tmp = Math.exp(x);
} else {
tmp = Math.exp(-z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -7.8e+83) or not (x <= 720.0): tmp = math.exp(x) else: tmp = math.exp(-z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -7.8e+83) || !(x <= 720.0)) tmp = exp(x); else tmp = exp(Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -7.8e+83) || ~((x <= 720.0))) tmp = exp(x); else tmp = exp(-z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -7.8e+83], N[Not[LessEqual[x, 720.0]], $MachinePrecision]], N[Exp[x], $MachinePrecision], N[Exp[(-z)], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{+83} \lor \neg \left(x \leq 720\right):\\
\;\;\;\;e^{x}\\
\mathbf{else}:\\
\;\;\;\;e^{-z}\\
\end{array}
\end{array}
if x < -7.8000000000000003e83 or 720 < x Initial program 100.0%
Taylor expanded in x around inf 86.7%
if -7.8000000000000003e83 < x < 720Initial program 99.9%
Taylor expanded in z around inf 66.6%
neg-mul-166.6%
Simplified66.6%
Final simplification75.3%
(FPCore (x y z) :precision binary64 (if (<= z -6.5e+75) (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0))) (exp x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -6.5e+75) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else {
tmp = exp(x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-6.5d+75)) then
tmp = 1.0d0 + (z * ((z * (z * (-0.16666666666666666d0))) + (-1.0d0)))
else
tmp = exp(x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -6.5e+75) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else {
tmp = Math.exp(x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -6.5e+75: tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)) else: tmp = math.exp(x) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -6.5e+75) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(z * -0.16666666666666666)) + -1.0))); else tmp = exp(x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -6.5e+75) tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)); else tmp = exp(x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -6.5e+75], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[x], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+75}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{x}\\
\end{array}
\end{array}
if z < -6.4999999999999998e75Initial program 100.0%
Taylor expanded in z around inf 93.8%
neg-mul-193.8%
Simplified93.8%
Taylor expanded in z around 0 88.0%
Taylor expanded in z around inf 88.0%
*-commutative88.0%
Simplified88.0%
if -6.4999999999999998e75 < z Initial program 100.0%
Taylor expanded in x around inf 54.2%
Final simplification60.5%
(FPCore (x y z)
:precision binary64
(if (<= x -4e+98)
(+ 1.0 (* x (* x 0.5)))
(if (<= x 3.7e+81)
(+ 1.0 (* z (+ (* z (+ 0.5 (* z -0.16666666666666666))) -1.0)))
(+ 1.0 (* x (+ 1.0 (* x (+ 0.5 (* x 0.16666666666666666)))))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4e+98) {
tmp = 1.0 + (x * (x * 0.5));
} else if (x <= 3.7e+81) {
tmp = 1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4d+98)) then
tmp = 1.0d0 + (x * (x * 0.5d0))
else if (x <= 3.7d+81) then
tmp = 1.0d0 + (z * ((z * (0.5d0 + (z * (-0.16666666666666666d0)))) + (-1.0d0)))
else
tmp = 1.0d0 + (x * (1.0d0 + (x * (0.5d0 + (x * 0.16666666666666666d0)))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4e+98) {
tmp = 1.0 + (x * (x * 0.5));
} else if (x <= 3.7e+81) {
tmp = 1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4e+98: tmp = 1.0 + (x * (x * 0.5)) elif x <= 3.7e+81: tmp = 1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0)) else: tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666))))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4e+98) tmp = Float64(1.0 + Float64(x * Float64(x * 0.5))); elseif (x <= 3.7e+81) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(0.5 + Float64(z * -0.16666666666666666))) + -1.0))); else tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4e+98) tmp = 1.0 + (x * (x * 0.5)); elseif (x <= 3.7e+81) tmp = 1.0 + (z * ((z * (0.5 + (z * -0.16666666666666666))) + -1.0)); else tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4e+98], N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.7e+81], N[(1.0 + N[(z * N[(N[(z * N[(0.5 + N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * N[(0.5 + N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+98}:\\
\;\;\;\;1 + x \cdot \left(x \cdot 0.5\right)\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+81}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(0.5 + z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if x < -3.99999999999999999e98Initial program 100.0%
Taylor expanded in x around inf 77.6%
Taylor expanded in x around 0 13.5%
Taylor expanded in x around inf 13.5%
*-commutative13.5%
Simplified13.5%
if -3.99999999999999999e98 < x < 3.7000000000000001e81Initial program 99.9%
Taylor expanded in z around inf 64.2%
neg-mul-164.2%
Simplified64.2%
Taylor expanded in z around 0 37.7%
if 3.7000000000000001e81 < x Initial program 100.0%
Taylor expanded in x around inf 95.8%
Taylor expanded in x around 0 84.2%
Final simplification42.1%
(FPCore (x y z)
:precision binary64
(if (<= x -4e+98)
(+ 1.0 (* x (* x 0.5)))
(if (<= x 3.7e+81)
(+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0)))
(+ 1.0 (* x (+ 1.0 (* x (+ 0.5 (* x 0.16666666666666666)))))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4e+98) {
tmp = 1.0 + (x * (x * 0.5));
} else if (x <= 3.7e+81) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4d+98)) then
tmp = 1.0d0 + (x * (x * 0.5d0))
else if (x <= 3.7d+81) then
tmp = 1.0d0 + (z * ((z * (z * (-0.16666666666666666d0))) + (-1.0d0)))
else
tmp = 1.0d0 + (x * (1.0d0 + (x * (0.5d0 + (x * 0.16666666666666666d0)))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4e+98) {
tmp = 1.0 + (x * (x * 0.5));
} else if (x <= 3.7e+81) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666)))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4e+98: tmp = 1.0 + (x * (x * 0.5)) elif x <= 3.7e+81: tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)) else: tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666))))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4e+98) tmp = Float64(1.0 + Float64(x * Float64(x * 0.5))); elseif (x <= 3.7e+81) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(z * -0.16666666666666666)) + -1.0))); else tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4e+98) tmp = 1.0 + (x * (x * 0.5)); elseif (x <= 3.7e+81) tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)); else tmp = 1.0 + (x * (1.0 + (x * (0.5 + (x * 0.16666666666666666))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4e+98], N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.7e+81], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * N[(0.5 + N[(x * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+98}:\\
\;\;\;\;1 + x \cdot \left(x \cdot 0.5\right)\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+81}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot \left(0.5 + x \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if x < -3.99999999999999999e98Initial program 100.0%
Taylor expanded in x around inf 77.6%
Taylor expanded in x around 0 13.5%
Taylor expanded in x around inf 13.5%
*-commutative13.5%
Simplified13.5%
if -3.99999999999999999e98 < x < 3.7000000000000001e81Initial program 99.9%
Taylor expanded in z around inf 64.2%
neg-mul-164.2%
Simplified64.2%
Taylor expanded in z around 0 37.7%
Taylor expanded in z around inf 37.3%
*-commutative37.3%
Simplified37.3%
if 3.7000000000000001e81 < x Initial program 100.0%
Taylor expanded in x around inf 95.8%
Taylor expanded in x around 0 84.2%
Final simplification41.8%
(FPCore (x y z) :precision binary64 (if (<= z -3.5e-10) (+ 1.0 (* z (+ (* z (* z -0.16666666666666666)) -1.0))) (+ 1.0 (* x (+ 1.0 (* x 0.5))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.5e-10) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3.5d-10)) then
tmp = 1.0d0 + (z * ((z * (z * (-0.16666666666666666d0))) + (-1.0d0)))
else
tmp = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.5e-10) {
tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.5e-10: tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)) else: tmp = 1.0 + (x * (1.0 + (x * 0.5))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.5e-10) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * Float64(z * -0.16666666666666666)) + -1.0))); else tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.5e-10) tmp = 1.0 + (z * ((z * (z * -0.16666666666666666)) + -1.0)); else tmp = 1.0 + (x * (1.0 + (x * 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.5e-10], N[(1.0 + N[(z * N[(N[(z * N[(z * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-10}:\\
\;\;\;\;1 + z \cdot \left(z \cdot \left(z \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\
\end{array}
\end{array}
if z < -3.4999999999999998e-10Initial program 100.0%
Taylor expanded in z around inf 84.6%
neg-mul-184.6%
Simplified84.6%
Taylor expanded in z around 0 65.3%
Taylor expanded in z around inf 64.9%
*-commutative64.9%
Simplified64.9%
if -3.4999999999999998e-10 < z Initial program 99.9%
Taylor expanded in x around inf 53.7%
Taylor expanded in x around 0 27.5%
Final simplification37.7%
(FPCore (x y z) :precision binary64 (if (<= x 6e+146) (+ 1.0 (* z (+ (* z 0.5) -1.0))) (+ 1.0 (* x (+ 1.0 (* x 0.5))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 6e+146) {
tmp = 1.0 + (z * ((z * 0.5) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 6d+146) then
tmp = 1.0d0 + (z * ((z * 0.5d0) + (-1.0d0)))
else
tmp = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 6e+146) {
tmp = 1.0 + (z * ((z * 0.5) + -1.0));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 6e+146: tmp = 1.0 + (z * ((z * 0.5) + -1.0)) else: tmp = 1.0 + (x * (1.0 + (x * 0.5))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 6e+146) tmp = Float64(1.0 + Float64(z * Float64(Float64(z * 0.5) + -1.0))); else tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 6e+146) tmp = 1.0 + (z * ((z * 0.5) + -1.0)); else tmp = 1.0 + (x * (1.0 + (x * 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 6e+146], N[(1.0 + N[(z * N[(N[(z * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6 \cdot 10^{+146}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5 + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\
\end{array}
\end{array}
if x < 6.00000000000000005e146Initial program 100.0%
Taylor expanded in z around inf 53.2%
neg-mul-153.2%
Simplified53.2%
Taylor expanded in z around 0 28.6%
if 6.00000000000000005e146 < x Initial program 100.0%
Taylor expanded in x around inf 96.2%
Taylor expanded in x around 0 89.5%
Final simplification34.8%
(FPCore (x y z) :precision binary64 (if (<= z -1.4e+111) (+ 1.0 (* z (* z 0.5))) (+ 1.0 (* x (+ 1.0 (* x 0.5))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.4e+111) {
tmp = 1.0 + (z * (z * 0.5));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.4d+111)) then
tmp = 1.0d0 + (z * (z * 0.5d0))
else
tmp = 1.0d0 + (x * (1.0d0 + (x * 0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.4e+111) {
tmp = 1.0 + (z * (z * 0.5));
} else {
tmp = 1.0 + (x * (1.0 + (x * 0.5)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.4e+111: tmp = 1.0 + (z * (z * 0.5)) else: tmp = 1.0 + (x * (1.0 + (x * 0.5))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.4e+111) tmp = Float64(1.0 + Float64(z * Float64(z * 0.5))); else tmp = Float64(1.0 + Float64(x * Float64(1.0 + Float64(x * 0.5)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.4e+111) tmp = 1.0 + (z * (z * 0.5)); else tmp = 1.0 + (x * (1.0 + (x * 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.4e+111], N[(1.0 + N[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+111}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(1 + x \cdot 0.5\right)\\
\end{array}
\end{array}
if z < -1.4e111Initial program 100.0%
Taylor expanded in z around inf 93.3%
neg-mul-193.3%
Simplified93.3%
Taylor expanded in z around 0 76.5%
Taylor expanded in z around inf 76.5%
if -1.4e111 < z Initial program 100.0%
Taylor expanded in x around inf 53.6%
Taylor expanded in x around 0 25.7%
Final simplification34.4%
(FPCore (x y z) :precision binary64 (if (<= z -5.2e+110) (+ 1.0 (* z (* z 0.5))) (+ 1.0 (* x (* x 0.5)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.2e+110) {
tmp = 1.0 + (z * (z * 0.5));
} else {
tmp = 1.0 + (x * (x * 0.5));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-5.2d+110)) then
tmp = 1.0d0 + (z * (z * 0.5d0))
else
tmp = 1.0d0 + (x * (x * 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.2e+110) {
tmp = 1.0 + (z * (z * 0.5));
} else {
tmp = 1.0 + (x * (x * 0.5));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.2e+110: tmp = 1.0 + (z * (z * 0.5)) else: tmp = 1.0 + (x * (x * 0.5)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.2e+110) tmp = Float64(1.0 + Float64(z * Float64(z * 0.5))); else tmp = Float64(1.0 + Float64(x * Float64(x * 0.5))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.2e+110) tmp = 1.0 + (z * (z * 0.5)); else tmp = 1.0 + (x * (x * 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.2e+110], N[(1.0 + N[(z * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+110}:\\
\;\;\;\;1 + z \cdot \left(z \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if z < -5.2e110Initial program 100.0%
Taylor expanded in z around inf 93.3%
neg-mul-193.3%
Simplified93.3%
Taylor expanded in z around 0 76.5%
Taylor expanded in z around inf 76.5%
if -5.2e110 < z Initial program 100.0%
Taylor expanded in x around inf 53.6%
Taylor expanded in x around 0 25.7%
Taylor expanded in x around inf 25.6%
*-commutative25.6%
Simplified25.6%
Final simplification34.3%
(FPCore (x y z) :precision binary64 (+ 1.0 (* x (* x 0.5))))
double code(double x, double y, double z) {
return 1.0 + (x * (x * 0.5));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 + (x * (x * 0.5d0))
end function
public static double code(double x, double y, double z) {
return 1.0 + (x * (x * 0.5));
}
def code(x, y, z): return 1.0 + (x * (x * 0.5))
function code(x, y, z) return Float64(1.0 + Float64(x * Float64(x * 0.5))) end
function tmp = code(x, y, z) tmp = 1.0 + (x * (x * 0.5)); end
code[x_, y_, z_] := N[(1.0 + N[(x * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + x \cdot \left(x \cdot 0.5\right)
\end{array}
Initial program 100.0%
Taylor expanded in x around inf 50.6%
Taylor expanded in x around 0 23.4%
Taylor expanded in x around inf 23.3%
*-commutative23.3%
Simplified23.3%
(FPCore (x y z) :precision binary64 (- 1.0 z))
double code(double x, double y, double z) {
return 1.0 - z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 - z
end function
public static double code(double x, double y, double z) {
return 1.0 - z;
}
def code(x, y, z): return 1.0 - z
function code(x, y, z) return Float64(1.0 - z) end
function tmp = code(x, y, z) tmp = 1.0 - z; end
code[x_, y_, z_] := N[(1.0 - z), $MachinePrecision]
\begin{array}{l}
\\
1 - z
\end{array}
Initial program 100.0%
Taylor expanded in z around inf 50.3%
neg-mul-150.3%
Simplified50.3%
Taylor expanded in z around 0 13.0%
neg-mul-113.0%
unsub-neg13.0%
Simplified13.0%
(FPCore (x y z) :precision binary64 (+ x 1.0))
double code(double x, double y, double z) {
return x + 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + 1.0d0
end function
public static double code(double x, double y, double z) {
return x + 1.0;
}
def code(x, y, z): return x + 1.0
function code(x, y, z) return Float64(x + 1.0) end
function tmp = code(x, y, z) tmp = x + 1.0; end
code[x_, y_, z_] := N[(x + 1.0), $MachinePrecision]
\begin{array}{l}
\\
x + 1
\end{array}
Initial program 100.0%
Taylor expanded in x around inf 50.6%
Taylor expanded in x around 0 12.6%
Final simplification12.6%
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
return 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0
end function
public static double code(double x, double y, double z) {
return 1.0;
}
def code(x, y, z): return 1.0
function code(x, y, z) return 1.0 end
function tmp = code(x, y, z) tmp = 1.0; end
code[x_, y_, z_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
Taylor expanded in x around inf 50.6%
Taylor expanded in x around 0 12.5%
(FPCore (x y z) :precision binary64 (exp (+ (- x z) (* (log y) y))))
double code(double x, double y, double z) {
return exp(((x - z) + (log(y) * y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = exp(((x - z) + (log(y) * y)))
end function
public static double code(double x, double y, double z) {
return Math.exp(((x - z) + (Math.log(y) * y)));
}
def code(x, y, z): return math.exp(((x - z) + (math.log(y) * y)))
function code(x, y, z) return exp(Float64(Float64(x - z) + Float64(log(y) * y))) end
function tmp = code(x, y, z) tmp = exp(((x - z) + (log(y) * y))); end
code[x_, y_, z_] := N[Exp[N[(N[(x - z), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(x - z\right) + \log y \cdot y}
\end{array}
herbie shell --seed 2024165
(FPCore (x y z)
:name "Statistics.Distribution.Poisson.Internal:probability from math-functions-0.1.5.2"
:precision binary64
:alt
(! :herbie-platform default (exp (+ (- x z) (* (log y) y))))
(exp (- (+ x (* y (log y))) z)))