
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (<= y -1.18e+36)
(* t_1 (- y))
(if (<= y 4.9e-101)
(* (sqrt z) (* x (pow 2.0 -0.5)))
(if (<= y 3.1e-5)
(* (exp (/ (* t t) 2.0)) (* y t_1))
(if (<= y 1.5e+113)
(/ (* x (sqrt z)) (sqrt 2.0))
(- (sqrt (* (* z 2.0) (pow y 2.0))))))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if (y <= -1.18e+36) {
tmp = t_1 * -y;
} else if (y <= 4.9e-101) {
tmp = sqrt(z) * (x * pow(2.0, -0.5));
} else if (y <= 3.1e-5) {
tmp = exp(((t * t) / 2.0)) * (y * t_1);
} else if (y <= 1.5e+113) {
tmp = (x * sqrt(z)) / sqrt(2.0);
} else {
tmp = -sqrt(((z * 2.0) * pow(y, 2.0)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((z * 2.0d0))
if (y <= (-1.18d+36)) then
tmp = t_1 * -y
else if (y <= 4.9d-101) then
tmp = sqrt(z) * (x * (2.0d0 ** (-0.5d0)))
else if (y <= 3.1d-5) then
tmp = exp(((t * t) / 2.0d0)) * (y * t_1)
else if (y <= 1.5d+113) then
tmp = (x * sqrt(z)) / sqrt(2.0d0)
else
tmp = -sqrt(((z * 2.0d0) * (y ** 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z * 2.0));
double tmp;
if (y <= -1.18e+36) {
tmp = t_1 * -y;
} else if (y <= 4.9e-101) {
tmp = Math.sqrt(z) * (x * Math.pow(2.0, -0.5));
} else if (y <= 3.1e-5) {
tmp = Math.exp(((t * t) / 2.0)) * (y * t_1);
} else if (y <= 1.5e+113) {
tmp = (x * Math.sqrt(z)) / Math.sqrt(2.0);
} else {
tmp = -Math.sqrt(((z * 2.0) * Math.pow(y, 2.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if y <= -1.18e+36: tmp = t_1 * -y elif y <= 4.9e-101: tmp = math.sqrt(z) * (x * math.pow(2.0, -0.5)) elif y <= 3.1e-5: tmp = math.exp(((t * t) / 2.0)) * (y * t_1) elif y <= 1.5e+113: tmp = (x * math.sqrt(z)) / math.sqrt(2.0) else: tmp = -math.sqrt(((z * 2.0) * math.pow(y, 2.0))) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (y <= -1.18e+36) tmp = Float64(t_1 * Float64(-y)); elseif (y <= 4.9e-101) tmp = Float64(sqrt(z) * Float64(x * (2.0 ^ -0.5))); elseif (y <= 3.1e-5) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(y * t_1)); elseif (y <= 1.5e+113) tmp = Float64(Float64(x * sqrt(z)) / sqrt(2.0)); else tmp = Float64(-sqrt(Float64(Float64(z * 2.0) * (y ^ 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if (y <= -1.18e+36) tmp = t_1 * -y; elseif (y <= 4.9e-101) tmp = sqrt(z) * (x * (2.0 ^ -0.5)); elseif (y <= 3.1e-5) tmp = exp(((t * t) / 2.0)) * (y * t_1); elseif (y <= 1.5e+113) tmp = (x * sqrt(z)) / sqrt(2.0); else tmp = -sqrt(((z * 2.0) * (y ^ 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -1.18e+36], N[(t$95$1 * (-y)), $MachinePrecision], If[LessEqual[y, 4.9e-101], N[(N[Sqrt[z], $MachinePrecision] * N[(x * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e-5], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(y * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+113], N[(N[(x * N[Sqrt[z], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;y \leq -1.18 \cdot 10^{+36}:\\
\;\;\;\;t\_1 \cdot \left(-y\right)\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{-101}:\\
\;\;\;\;\sqrt{z} \cdot \left(x \cdot {2}^{-0.5}\right)\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-5}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(y \cdot t\_1\right)\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+113}:\\
\;\;\;\;\frac{x \cdot \sqrt{z}}{\sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\left(z \cdot 2\right) \cdot {y}^{2}}\\
\end{array}
\end{array}
if y < -1.17999999999999997e36Initial program 99.9%
Taylor expanded in x around 0 89.2%
mul-1-neg89.2%
associate-*l*89.2%
distribute-rgt-neg-in89.2%
distribute-rgt-neg-in89.2%
Simplified89.2%
associate-*r*89.2%
distribute-rgt-neg-out89.2%
neg-sub089.2%
add-sqr-sqrt89.2%
sqr-neg89.2%
sqrt-unprod0.0%
add-sqr-sqrt2.1%
associate-*r*2.1%
add-sqr-sqrt0.0%
sqrt-unprod89.2%
sqr-neg89.2%
add-sqr-sqrt89.2%
sqrt-prod89.4%
Applied egg-rr89.4%
neg-sub089.4%
distribute-lft-neg-in89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in t around 0 49.7%
mul-1-neg49.7%
associate-*l*49.7%
Simplified49.7%
sqrt-prod49.9%
add049.9%
Applied egg-rr49.9%
add049.9%
Simplified49.9%
if -1.17999999999999997e36 < y < 4.9e-101Initial program 99.7%
add099.7%
flip-+66.8%
*-commutative66.8%
*-commutative66.8%
swap-sqr58.4%
add-sqr-sqrt58.5%
metadata-eval58.5%
fma-neg58.5%
pow258.5%
metadata-eval58.5%
fma-neg58.5%
metadata-eval58.5%
fma-define58.5%
add058.5%
Applied egg-rr58.5%
fma-undefine58.5%
add058.5%
associate-*l*58.5%
associate-/l*69.7%
associate-/l*69.7%
associate-/r*75.2%
unpow275.2%
associate-/l*94.6%
*-inverses94.6%
*-rgt-identity94.6%
*-commutative94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in x around inf 86.6%
Taylor expanded in t around 0 52.8%
div-inv52.7%
pow1/252.7%
pow-flip52.8%
metadata-eval52.8%
Applied egg-rr52.8%
if 4.9e-101 < y < 3.10000000000000014e-5Initial program 99.9%
Taylor expanded in x around 0 54.1%
mul-1-neg54.1%
associate-*l*54.0%
distribute-rgt-neg-in54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
add-sqr-sqrt0.0%
sqrt-unprod42.5%
sqr-neg42.5%
add-sqr-sqrt42.5%
sqrt-prod42.5%
add042.5%
Applied egg-rr42.5%
add042.5%
Simplified42.5%
if 3.10000000000000014e-5 < y < 1.5e113Initial program 99.8%
add099.8%
flip-+74.2%
*-commutative74.2%
*-commutative74.2%
swap-sqr70.3%
add-sqr-sqrt70.5%
metadata-eval70.5%
fma-neg70.5%
pow270.5%
metadata-eval70.5%
fma-neg70.5%
metadata-eval70.5%
fma-define70.5%
add070.5%
Applied egg-rr70.5%
fma-undefine70.5%
add070.5%
associate-*l*70.5%
associate-/l*73.9%
associate-/l*73.9%
associate-/r*81.6%
unpow281.6%
associate-/l*99.6%
*-inverses99.6%
*-rgt-identity99.6%
*-commutative99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 69.9%
Taylor expanded in t around 0 37.0%
associate-*l/37.0%
Applied egg-rr37.0%
if 1.5e113 < y Initial program 99.9%
Taylor expanded in x around 0 91.7%
mul-1-neg91.7%
associate-*l*91.8%
distribute-rgt-neg-in91.8%
distribute-rgt-neg-in91.8%
Simplified91.8%
associate-*r*91.7%
distribute-rgt-neg-out91.7%
neg-sub091.7%
add-sqr-sqrt91.7%
sqr-neg91.7%
sqrt-unprod0.0%
add-sqr-sqrt0.6%
associate-*r*0.6%
add-sqr-sqrt0.0%
sqrt-unprod91.8%
sqr-neg91.8%
add-sqr-sqrt91.8%
sqrt-prod91.9%
Applied egg-rr91.9%
neg-sub091.9%
distribute-lft-neg-in91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in t around 0 50.6%
mul-1-neg50.6%
associate-*l*50.6%
Simplified50.6%
rem-square-sqrt50.6%
sqrt-unprod68.2%
sqrt-prod68.2%
*-commutative68.2%
sqrt-prod68.2%
*-commutative68.2%
swap-sqr64.1%
add-sqr-sqrt64.1%
pow264.1%
Applied egg-rr64.1%
Final simplification51.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))) (t_2 (exp (/ (* t t) 2.0))))
(if (or (<= y -1.32e-42) (not (<= y 3.7e+87)))
(* t_2 (* t_1 (- y)))
(* t_2 (* (* x 0.5) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double t_2 = exp(((t * t) / 2.0));
double tmp;
if ((y <= -1.32e-42) || !(y <= 3.7e+87)) {
tmp = t_2 * (t_1 * -y);
} else {
tmp = t_2 * ((x * 0.5) * t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((z * 2.0d0))
t_2 = exp(((t * t) / 2.0d0))
if ((y <= (-1.32d-42)) .or. (.not. (y <= 3.7d+87))) then
tmp = t_2 * (t_1 * -y)
else
tmp = t_2 * ((x * 0.5d0) * t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z * 2.0));
double t_2 = Math.exp(((t * t) / 2.0));
double tmp;
if ((y <= -1.32e-42) || !(y <= 3.7e+87)) {
tmp = t_2 * (t_1 * -y);
} else {
tmp = t_2 * ((x * 0.5) * t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) t_2 = math.exp(((t * t) / 2.0)) tmp = 0 if (y <= -1.32e-42) or not (y <= 3.7e+87): tmp = t_2 * (t_1 * -y) else: tmp = t_2 * ((x * 0.5) * t_1) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) t_2 = exp(Float64(Float64(t * t) / 2.0)) tmp = 0.0 if ((y <= -1.32e-42) || !(y <= 3.7e+87)) tmp = Float64(t_2 * Float64(t_1 * Float64(-y))); else tmp = Float64(t_2 * Float64(Float64(x * 0.5) * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); t_2 = exp(((t * t) / 2.0)); tmp = 0.0; if ((y <= -1.32e-42) || ~((y <= 3.7e+87))) tmp = t_2 * (t_1 * -y); else tmp = t_2 * ((x * 0.5) * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y, -1.32e-42], N[Not[LessEqual[y, 3.7e+87]], $MachinePrecision]], N[(t$95$2 * N[(t$95$1 * (-y)), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[(x * 0.5), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
t_2 := e^{\frac{t \cdot t}{2}}\\
\mathbf{if}\;y \leq -1.32 \cdot 10^{-42} \lor \neg \left(y \leq 3.7 \cdot 10^{+87}\right):\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(\left(x \cdot 0.5\right) \cdot t\_1\right)\\
\end{array}
\end{array}
if y < -1.32000000000000006e-42 or 3.70000000000000003e87 < y Initial program 99.9%
Taylor expanded in x around 0 88.0%
mul-1-neg88.0%
associate-*l*87.9%
distribute-rgt-neg-in87.9%
distribute-rgt-neg-in87.9%
Simplified87.9%
associate-*r*88.0%
distribute-rgt-neg-out88.0%
neg-sub088.0%
add-sqr-sqrt88.0%
sqr-neg88.0%
sqrt-unprod0.0%
add-sqr-sqrt2.3%
associate-*r*2.3%
add-sqr-sqrt0.0%
sqrt-unprod87.9%
sqr-neg87.9%
add-sqr-sqrt87.9%
sqrt-prod88.1%
Applied egg-rr88.1%
neg-sub088.1%
distribute-lft-neg-in88.1%
*-commutative88.1%
Simplified88.1%
if -1.32000000000000006e-42 < y < 3.70000000000000003e87Initial program 99.8%
Taylor expanded in x around inf 81.8%
associate-*r*81.8%
*-commutative81.8%
associate-*r*81.8%
Simplified81.8%
add081.8%
*-commutative81.8%
associate-*r*81.8%
sqrt-prod81.9%
*-commutative81.9%
Applied egg-rr81.9%
add081.9%
Simplified81.9%
Final simplification84.9%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.75e+205)
(* (/ x (sqrt 2.0)) (sqrt z))
(if (<= x 5.2e+153)
(* (exp (/ (* t t) 2.0)) (* (sqrt (* z 2.0)) (- y)))
(if (<= x 3.5e+256)
(* x (/ (sqrt z) (sqrt 2.0)))
(sqrt (/ (* z (pow x 2.0)) 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.75e+205) {
tmp = (x / sqrt(2.0)) * sqrt(z);
} else if (x <= 5.2e+153) {
tmp = exp(((t * t) / 2.0)) * (sqrt((z * 2.0)) * -y);
} else if (x <= 3.5e+256) {
tmp = x * (sqrt(z) / sqrt(2.0));
} else {
tmp = sqrt(((z * pow(x, 2.0)) / 2.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.75d+205)) then
tmp = (x / sqrt(2.0d0)) * sqrt(z)
else if (x <= 5.2d+153) then
tmp = exp(((t * t) / 2.0d0)) * (sqrt((z * 2.0d0)) * -y)
else if (x <= 3.5d+256) then
tmp = x * (sqrt(z) / sqrt(2.0d0))
else
tmp = sqrt(((z * (x ** 2.0d0)) / 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.75e+205) {
tmp = (x / Math.sqrt(2.0)) * Math.sqrt(z);
} else if (x <= 5.2e+153) {
tmp = Math.exp(((t * t) / 2.0)) * (Math.sqrt((z * 2.0)) * -y);
} else if (x <= 3.5e+256) {
tmp = x * (Math.sqrt(z) / Math.sqrt(2.0));
} else {
tmp = Math.sqrt(((z * Math.pow(x, 2.0)) / 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.75e+205: tmp = (x / math.sqrt(2.0)) * math.sqrt(z) elif x <= 5.2e+153: tmp = math.exp(((t * t) / 2.0)) * (math.sqrt((z * 2.0)) * -y) elif x <= 3.5e+256: tmp = x * (math.sqrt(z) / math.sqrt(2.0)) else: tmp = math.sqrt(((z * math.pow(x, 2.0)) / 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.75e+205) tmp = Float64(Float64(x / sqrt(2.0)) * sqrt(z)); elseif (x <= 5.2e+153) tmp = Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(sqrt(Float64(z * 2.0)) * Float64(-y))); elseif (x <= 3.5e+256) tmp = Float64(x * Float64(sqrt(z) / sqrt(2.0))); else tmp = sqrt(Float64(Float64(z * (x ^ 2.0)) / 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.75e+205) tmp = (x / sqrt(2.0)) * sqrt(z); elseif (x <= 5.2e+153) tmp = exp(((t * t) / 2.0)) * (sqrt((z * 2.0)) * -y); elseif (x <= 3.5e+256) tmp = x * (sqrt(z) / sqrt(2.0)); else tmp = sqrt(((z * (x ^ 2.0)) / 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.75e+205], N[(N[(x / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+153], N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e+256], N[(x * N[(N[Sqrt[z], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(z * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+205}:\\
\;\;\;\;\frac{x}{\sqrt{2}} \cdot \sqrt{z}\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+153}:\\
\;\;\;\;e^{\frac{t \cdot t}{2}} \cdot \left(\sqrt{z \cdot 2} \cdot \left(-y\right)\right)\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+256}:\\
\;\;\;\;x \cdot \frac{\sqrt{z}}{\sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{z \cdot {x}^{2}}{2}}\\
\end{array}
\end{array}
if x < -1.7499999999999999e205Initial program 99.9%
add099.9%
flip-+22.7%
*-commutative22.7%
*-commutative22.7%
swap-sqr22.7%
add-sqr-sqrt22.7%
metadata-eval22.7%
fma-neg22.7%
pow222.7%
metadata-eval22.7%
fma-neg22.7%
metadata-eval22.7%
fma-define22.7%
add022.7%
Applied egg-rr22.7%
fma-undefine22.7%
add022.7%
associate-*l*22.7%
associate-/l*22.7%
associate-/l*22.7%
associate-/r*72.7%
unpow272.7%
associate-/l*84.2%
*-inverses84.2%
*-rgt-identity84.2%
*-commutative84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in x around inf 95.8%
Taylor expanded in t around 0 68.9%
if -1.7499999999999999e205 < x < 5.1999999999999998e153Initial program 99.8%
Taylor expanded in x around 0 74.4%
mul-1-neg74.4%
associate-*l*74.4%
distribute-rgt-neg-in74.4%
distribute-rgt-neg-in74.4%
Simplified74.4%
associate-*r*74.4%
distribute-rgt-neg-out74.4%
neg-sub074.4%
add-sqr-sqrt74.4%
sqr-neg74.4%
sqrt-unprod0.0%
add-sqr-sqrt8.3%
associate-*r*8.3%
add-sqr-sqrt0.0%
sqrt-unprod74.4%
sqr-neg74.4%
add-sqr-sqrt74.4%
sqrt-prod74.5%
Applied egg-rr74.5%
neg-sub074.5%
distribute-lft-neg-in74.5%
*-commutative74.5%
Simplified74.5%
if 5.1999999999999998e153 < x < 3.4999999999999998e256Initial program 99.8%
add099.8%
flip-+52.3%
*-commutative52.3%
*-commutative52.3%
swap-sqr40.3%
add-sqr-sqrt40.3%
metadata-eval40.3%
fma-neg40.3%
pow240.3%
metadata-eval40.3%
fma-neg40.3%
metadata-eval40.3%
fma-define40.3%
add040.3%
Applied egg-rr40.3%
fma-undefine40.3%
add040.3%
associate-*l*40.3%
associate-/l*40.3%
associate-/l*40.3%
associate-/r*48.7%
unpow248.7%
associate-/l*95.6%
*-inverses95.6%
*-rgt-identity95.6%
*-commutative95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in x around inf 96.9%
Taylor expanded in t around 0 69.2%
*-commutative69.2%
clear-num69.3%
un-div-inv69.2%
Applied egg-rr69.2%
associate-/r/69.3%
Simplified69.3%
if 3.4999999999999998e256 < x Initial program 99.9%
add099.9%
flip-+54.4%
*-commutative54.4%
*-commutative54.4%
swap-sqr54.4%
add-sqr-sqrt54.4%
metadata-eval54.4%
fma-neg54.4%
pow254.4%
metadata-eval54.4%
fma-neg54.4%
metadata-eval54.4%
fma-define54.4%
add054.4%
Applied egg-rr54.4%
fma-undefine54.4%
add054.4%
associate-*l*54.4%
associate-/l*54.4%
associate-/l*54.4%
associate-/r*92.9%
unpow292.9%
associate-/l*100.0%
*-inverses100.0%
*-rgt-identity100.0%
*-commutative100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.9%
Taylor expanded in t around 0 50.3%
add-sqr-sqrt50.4%
sqrt-unprod92.9%
*-commutative92.9%
*-commutative92.9%
swap-sqr92.9%
add-sqr-sqrt92.9%
frac-times92.9%
pow292.9%
rem-square-sqrt92.9%
Applied egg-rr92.9%
associate-*r/92.9%
Simplified92.9%
Final simplification74.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.6e+35)
(* (sqrt (* z 2.0)) (- y))
(if (<= y 1.4e+113)
(* (sqrt z) (* x (pow 2.0 -0.5)))
(- (sqrt (* (* z 2.0) (pow y 2.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e+35) {
tmp = sqrt((z * 2.0)) * -y;
} else if (y <= 1.4e+113) {
tmp = sqrt(z) * (x * pow(2.0, -0.5));
} else {
tmp = -sqrt(((z * 2.0) * pow(y, 2.0)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.6d+35)) then
tmp = sqrt((z * 2.0d0)) * -y
else if (y <= 1.4d+113) then
tmp = sqrt(z) * (x * (2.0d0 ** (-0.5d0)))
else
tmp = -sqrt(((z * 2.0d0) * (y ** 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e+35) {
tmp = Math.sqrt((z * 2.0)) * -y;
} else if (y <= 1.4e+113) {
tmp = Math.sqrt(z) * (x * Math.pow(2.0, -0.5));
} else {
tmp = -Math.sqrt(((z * 2.0) * Math.pow(y, 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.6e+35: tmp = math.sqrt((z * 2.0)) * -y elif y <= 1.4e+113: tmp = math.sqrt(z) * (x * math.pow(2.0, -0.5)) else: tmp = -math.sqrt(((z * 2.0) * math.pow(y, 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.6e+35) tmp = Float64(sqrt(Float64(z * 2.0)) * Float64(-y)); elseif (y <= 1.4e+113) tmp = Float64(sqrt(z) * Float64(x * (2.0 ^ -0.5))); else tmp = Float64(-sqrt(Float64(Float64(z * 2.0) * (y ^ 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.6e+35) tmp = sqrt((z * 2.0)) * -y; elseif (y <= 1.4e+113) tmp = sqrt(z) * (x * (2.0 ^ -0.5)); else tmp = -sqrt(((z * 2.0) * (y ^ 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.6e+35], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[y, 1.4e+113], N[(N[Sqrt[z], $MachinePrecision] * N[(x * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+35}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left(-y\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+113}:\\
\;\;\;\;\sqrt{z} \cdot \left(x \cdot {2}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\left(z \cdot 2\right) \cdot {y}^{2}}\\
\end{array}
\end{array}
if y < -1.59999999999999991e35Initial program 99.9%
Taylor expanded in x around 0 89.2%
mul-1-neg89.2%
associate-*l*89.2%
distribute-rgt-neg-in89.2%
distribute-rgt-neg-in89.2%
Simplified89.2%
associate-*r*89.2%
distribute-rgt-neg-out89.2%
neg-sub089.2%
add-sqr-sqrt89.2%
sqr-neg89.2%
sqrt-unprod0.0%
add-sqr-sqrt2.1%
associate-*r*2.1%
add-sqr-sqrt0.0%
sqrt-unprod89.2%
sqr-neg89.2%
add-sqr-sqrt89.2%
sqrt-prod89.4%
Applied egg-rr89.4%
neg-sub089.4%
distribute-lft-neg-in89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in t around 0 49.7%
mul-1-neg49.7%
associate-*l*49.7%
Simplified49.7%
sqrt-prod49.9%
add049.9%
Applied egg-rr49.9%
add049.9%
Simplified49.9%
if -1.59999999999999991e35 < y < 1.39999999999999999e113Initial program 99.8%
add099.8%
flip-+70.9%
*-commutative70.9%
*-commutative70.9%
swap-sqr64.7%
add-sqr-sqrt64.8%
metadata-eval64.8%
fma-neg64.8%
pow264.8%
metadata-eval64.8%
fma-neg64.8%
metadata-eval64.8%
fma-define64.8%
add064.8%
Applied egg-rr64.8%
fma-undefine64.8%
add064.8%
associate-*l*64.8%
associate-/l*73.4%
associate-/l*73.4%
associate-/r*80.5%
unpow280.5%
associate-/l*96.4%
*-inverses96.4%
*-rgt-identity96.4%
*-commutative96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in x around inf 79.0%
Taylor expanded in t around 0 44.3%
div-inv44.3%
pow1/244.3%
pow-flip44.3%
metadata-eval44.3%
Applied egg-rr44.3%
if 1.39999999999999999e113 < y Initial program 99.9%
Taylor expanded in x around 0 91.7%
mul-1-neg91.7%
associate-*l*91.8%
distribute-rgt-neg-in91.8%
distribute-rgt-neg-in91.8%
Simplified91.8%
associate-*r*91.7%
distribute-rgt-neg-out91.7%
neg-sub091.7%
add-sqr-sqrt91.7%
sqr-neg91.7%
sqrt-unprod0.0%
add-sqr-sqrt0.6%
associate-*r*0.6%
add-sqr-sqrt0.0%
sqrt-unprod91.8%
sqr-neg91.8%
add-sqr-sqrt91.8%
sqrt-prod91.9%
Applied egg-rr91.9%
neg-sub091.9%
distribute-lft-neg-in91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in t around 0 50.6%
mul-1-neg50.6%
associate-*l*50.6%
Simplified50.6%
rem-square-sqrt50.6%
sqrt-unprod68.2%
sqrt-prod68.2%
*-commutative68.2%
sqrt-prod68.2%
*-commutative68.2%
swap-sqr64.1%
add-sqr-sqrt64.1%
pow264.1%
Applied egg-rr64.1%
Final simplification49.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1e+36) (not (<= y 1.5e+113))) (* (sqrt (* z 2.0)) (- y)) (* (sqrt z) (* x (pow 2.0 -0.5)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e+36) || !(y <= 1.5e+113)) {
tmp = sqrt((z * 2.0)) * -y;
} else {
tmp = sqrt(z) * (x * pow(2.0, -0.5));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1d+36)) .or. (.not. (y <= 1.5d+113))) then
tmp = sqrt((z * 2.0d0)) * -y
else
tmp = sqrt(z) * (x * (2.0d0 ** (-0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e+36) || !(y <= 1.5e+113)) {
tmp = Math.sqrt((z * 2.0)) * -y;
} else {
tmp = Math.sqrt(z) * (x * Math.pow(2.0, -0.5));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1e+36) or not (y <= 1.5e+113): tmp = math.sqrt((z * 2.0)) * -y else: tmp = math.sqrt(z) * (x * math.pow(2.0, -0.5)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1e+36) || !(y <= 1.5e+113)) tmp = Float64(sqrt(Float64(z * 2.0)) * Float64(-y)); else tmp = Float64(sqrt(z) * Float64(x * (2.0 ^ -0.5))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1e+36) || ~((y <= 1.5e+113))) tmp = sqrt((z * 2.0)) * -y; else tmp = sqrt(z) * (x * (2.0 ^ -0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1e+36], N[Not[LessEqual[y, 1.5e+113]], $MachinePrecision]], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision], N[(N[Sqrt[z], $MachinePrecision] * N[(x * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+36} \lor \neg \left(y \leq 1.5 \cdot 10^{+113}\right):\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z} \cdot \left(x \cdot {2}^{-0.5}\right)\\
\end{array}
\end{array}
if y < -1.00000000000000004e36 or 1.5e113 < y Initial program 99.9%
Taylor expanded in x around 0 90.3%
mul-1-neg90.3%
associate-*l*90.3%
distribute-rgt-neg-in90.3%
distribute-rgt-neg-in90.3%
Simplified90.3%
associate-*r*90.3%
distribute-rgt-neg-out90.3%
neg-sub090.3%
add-sqr-sqrt90.3%
sqr-neg90.3%
sqrt-unprod0.0%
add-sqr-sqrt1.5%
associate-*r*1.5%
add-sqr-sqrt0.0%
sqrt-unprod90.3%
sqr-neg90.3%
add-sqr-sqrt90.3%
sqrt-prod90.5%
Applied egg-rr90.5%
neg-sub090.5%
distribute-lft-neg-in90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in t around 0 50.1%
mul-1-neg50.1%
associate-*l*50.1%
Simplified50.1%
sqrt-prod50.3%
add050.3%
Applied egg-rr50.3%
add050.3%
Simplified50.3%
if -1.00000000000000004e36 < y < 1.5e113Initial program 99.8%
add099.8%
flip-+70.9%
*-commutative70.9%
*-commutative70.9%
swap-sqr64.7%
add-sqr-sqrt64.8%
metadata-eval64.8%
fma-neg64.8%
pow264.8%
metadata-eval64.8%
fma-neg64.8%
metadata-eval64.8%
fma-define64.8%
add064.8%
Applied egg-rr64.8%
fma-undefine64.8%
add064.8%
associate-*l*64.8%
associate-/l*73.4%
associate-/l*73.4%
associate-/r*80.5%
unpow280.5%
associate-/l*96.4%
*-inverses96.4%
*-rgt-identity96.4%
*-commutative96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in x around inf 79.0%
Taylor expanded in t around 0 44.3%
div-inv44.3%
pow1/244.3%
pow-flip44.3%
metadata-eval44.3%
Applied egg-rr44.3%
Final simplification46.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.55e+35) (not (<= y 2.7e+113))) (* (sqrt (* z 2.0)) (- y)) (* (/ x (sqrt 2.0)) (sqrt z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.55e+35) || !(y <= 2.7e+113)) {
tmp = sqrt((z * 2.0)) * -y;
} else {
tmp = (x / sqrt(2.0)) * sqrt(z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.55d+35)) .or. (.not. (y <= 2.7d+113))) then
tmp = sqrt((z * 2.0d0)) * -y
else
tmp = (x / sqrt(2.0d0)) * sqrt(z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.55e+35) || !(y <= 2.7e+113)) {
tmp = Math.sqrt((z * 2.0)) * -y;
} else {
tmp = (x / Math.sqrt(2.0)) * Math.sqrt(z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.55e+35) or not (y <= 2.7e+113): tmp = math.sqrt((z * 2.0)) * -y else: tmp = (x / math.sqrt(2.0)) * math.sqrt(z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.55e+35) || !(y <= 2.7e+113)) tmp = Float64(sqrt(Float64(z * 2.0)) * Float64(-y)); else tmp = Float64(Float64(x / sqrt(2.0)) * sqrt(z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.55e+35) || ~((y <= 2.7e+113))) tmp = sqrt((z * 2.0)) * -y; else tmp = (x / sqrt(2.0)) * sqrt(z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.55e+35], N[Not[LessEqual[y, 2.7e+113]], $MachinePrecision]], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision], N[(N[(x / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.55 \cdot 10^{+35} \lor \neg \left(y \leq 2.7 \cdot 10^{+113}\right):\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\sqrt{2}} \cdot \sqrt{z}\\
\end{array}
\end{array}
if y < -2.55000000000000009e35 or 2.70000000000000011e113 < y Initial program 99.9%
Taylor expanded in x around 0 90.3%
mul-1-neg90.3%
associate-*l*90.3%
distribute-rgt-neg-in90.3%
distribute-rgt-neg-in90.3%
Simplified90.3%
associate-*r*90.3%
distribute-rgt-neg-out90.3%
neg-sub090.3%
add-sqr-sqrt90.3%
sqr-neg90.3%
sqrt-unprod0.0%
add-sqr-sqrt1.5%
associate-*r*1.5%
add-sqr-sqrt0.0%
sqrt-unprod90.3%
sqr-neg90.3%
add-sqr-sqrt90.3%
sqrt-prod90.5%
Applied egg-rr90.5%
neg-sub090.5%
distribute-lft-neg-in90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in t around 0 50.1%
mul-1-neg50.1%
associate-*l*50.1%
Simplified50.1%
sqrt-prod50.3%
add050.3%
Applied egg-rr50.3%
add050.3%
Simplified50.3%
if -2.55000000000000009e35 < y < 2.70000000000000011e113Initial program 99.8%
add099.8%
flip-+70.9%
*-commutative70.9%
*-commutative70.9%
swap-sqr64.7%
add-sqr-sqrt64.8%
metadata-eval64.8%
fma-neg64.8%
pow264.8%
metadata-eval64.8%
fma-neg64.8%
metadata-eval64.8%
fma-define64.8%
add064.8%
Applied egg-rr64.8%
fma-undefine64.8%
add064.8%
associate-*l*64.8%
associate-/l*73.4%
associate-/l*73.4%
associate-/r*80.5%
unpow280.5%
associate-/l*96.4%
*-inverses96.4%
*-rgt-identity96.4%
*-commutative96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in x around inf 79.0%
Taylor expanded in t around 0 44.3%
Final simplification46.9%
(FPCore (x y z t) :precision binary64 (if (<= z 5e+144) (* (sqrt (* z 2.0)) (- y)) (* y (/ (pow (* z 2.0) 1.5) (* z (- 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5e+144) {
tmp = sqrt((z * 2.0)) * -y;
} else {
tmp = y * (pow((z * 2.0), 1.5) / (z * -2.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 5d+144) then
tmp = sqrt((z * 2.0d0)) * -y
else
tmp = y * (((z * 2.0d0) ** 1.5d0) / (z * -2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5e+144) {
tmp = Math.sqrt((z * 2.0)) * -y;
} else {
tmp = y * (Math.pow((z * 2.0), 1.5) / (z * -2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 5e+144: tmp = math.sqrt((z * 2.0)) * -y else: tmp = y * (math.pow((z * 2.0), 1.5) / (z * -2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 5e+144) tmp = Float64(sqrt(Float64(z * 2.0)) * Float64(-y)); else tmp = Float64(y * Float64((Float64(z * 2.0) ^ 1.5) / Float64(z * Float64(-2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 5e+144) tmp = sqrt((z * 2.0)) * -y; else tmp = y * (((z * 2.0) ^ 1.5) / (z * -2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 5e+144], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision], N[(y * N[(N[Power[N[(z * 2.0), $MachinePrecision], 1.5], $MachinePrecision] / N[(z * (-2.0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{+144}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{{\left(z \cdot 2\right)}^{1.5}}{z \cdot \left(-2\right)}\\
\end{array}
\end{array}
if z < 4.9999999999999999e144Initial program 99.8%
Taylor expanded in x around 0 64.3%
mul-1-neg64.3%
associate-*l*64.2%
distribute-rgt-neg-in64.2%
distribute-rgt-neg-in64.2%
Simplified64.2%
associate-*r*64.3%
distribute-rgt-neg-out64.3%
neg-sub064.3%
add-sqr-sqrt64.3%
sqr-neg64.3%
sqrt-unprod0.0%
add-sqr-sqrt10.7%
associate-*r*10.7%
add-sqr-sqrt0.0%
sqrt-unprod64.2%
sqr-neg64.2%
add-sqr-sqrt64.2%
sqrt-prod64.3%
Applied egg-rr64.3%
neg-sub064.3%
distribute-lft-neg-in64.3%
*-commutative64.3%
Simplified64.3%
Taylor expanded in t around 0 27.0%
mul-1-neg27.0%
associate-*l*27.0%
Simplified27.0%
sqrt-prod27.1%
add027.1%
Applied egg-rr27.1%
add027.1%
Simplified27.1%
if 4.9999999999999999e144 < z Initial program 99.9%
Taylor expanded in x around 0 54.5%
mul-1-neg54.5%
associate-*l*54.5%
distribute-rgt-neg-in54.5%
distribute-rgt-neg-in54.5%
Simplified54.5%
associate-*r*54.5%
distribute-rgt-neg-out54.5%
neg-sub054.5%
add-sqr-sqrt54.5%
sqr-neg54.5%
sqrt-unprod0.0%
add-sqr-sqrt17.2%
associate-*r*17.2%
add-sqr-sqrt0.0%
sqrt-unprod54.5%
sqr-neg54.5%
add-sqr-sqrt54.5%
sqrt-prod54.6%
Applied egg-rr54.6%
neg-sub054.6%
distribute-lft-neg-in54.6%
*-commutative54.6%
Simplified54.6%
Taylor expanded in t around 0 39.2%
mul-1-neg39.2%
associate-*l*39.2%
Simplified39.2%
sqrt-prod39.3%
add039.3%
flip3-+49.4%
pow349.4%
add-sqr-sqrt49.4%
metadata-eval49.4%
add049.4%
pow149.4%
pow1/249.4%
pow-prod-up49.4%
metadata-eval49.4%
add-sqr-sqrt49.4%
metadata-eval49.4%
Applied egg-rr49.4%
sub0-neg49.4%
mul0-rgt49.4%
sub-neg49.4%
--rgt-identity49.4%
Simplified49.4%
Final simplification32.0%
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (- y)))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * -y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((z * 2.0d0)) * -y
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * -y;
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * -y
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(-y)) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * -y; end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(-y\right)
\end{array}
Initial program 99.8%
Taylor expanded in x around 0 62.1%
mul-1-neg62.1%
associate-*l*62.1%
distribute-rgt-neg-in62.1%
distribute-rgt-neg-in62.1%
Simplified62.1%
associate-*r*62.1%
distribute-rgt-neg-out62.1%
neg-sub062.1%
add-sqr-sqrt62.1%
sqr-neg62.1%
sqrt-unprod0.0%
add-sqr-sqrt12.1%
associate-*r*12.1%
add-sqr-sqrt0.0%
sqrt-unprod62.1%
sqr-neg62.1%
add-sqr-sqrt62.1%
sqrt-prod62.2%
Applied egg-rr62.2%
neg-sub062.2%
distribute-lft-neg-in62.2%
*-commutative62.2%
Simplified62.2%
Taylor expanded in t around 0 29.7%
mul-1-neg29.7%
associate-*l*29.7%
Simplified29.7%
sqrt-prod29.8%
add029.8%
Applied egg-rr29.8%
add029.8%
Simplified29.8%
Final simplification29.8%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * pow(exp(1.0), ((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * (exp(1.0d0) ** ((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.pow(Math.exp(1.0), ((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.pow(math.exp(1.0), ((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * (exp(1.0) ^ Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * (exp(1.0) ^ ((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[Exp[1.0], $MachinePrecision], N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot {\left(e^{1}\right)}^{\left(\frac{t \cdot t}{2}\right)}
\end{array}
herbie shell --seed 2024046
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
:alt
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0)))
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))