
(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 14 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 (* (sqrt (* z 2.0)) (* (sqrt (exp (* t t))) (- (* x 0.5) y))))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * (sqrt(exp((t * t))) * ((x * 0.5) - 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)) * (sqrt(exp((t * t))) * ((x * 0.5d0) - y))
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * (Math.sqrt(Math.exp((t * t))) * ((x * 0.5) - y));
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * (math.sqrt(math.exp((t * t))) * ((x * 0.5) - y))
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(sqrt(exp(Float64(t * t))) * Float64(Float64(x * 0.5) - y))) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * (sqrt(exp((t * t))) * ((x * 0.5) - y)); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(\sqrt{e^{t \cdot t}} \cdot \left(x \cdot 0.5 - y\right)\right)
\end{array}
Initial program 99.4%
*-commutative99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* z (* 2.0 (exp (pow t 2.0)))))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt((z * (2.0 * exp(pow(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 ** 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(Math.pow(t, 2.0)))));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt((z * (2.0 * math.exp(math.pow(t, 2.0)))))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * Float64(2.0 * exp((t ^ 2.0)))))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt((z * (2.0 * exp((t ^ 2.0))))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * N[(2.0 * N[Exp[N[Power[t, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot e^{{t}^{2}}\right)}
\end{array}
Initial program 99.4%
*-commutative99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
associate-*r*99.4%
*-commutative99.4%
expm1-log1p-u58.8%
expm1-udef44.5%
Applied egg-rr44.5%
expm1-def58.8%
expm1-log1p99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 6e+18)
(* t_1 (sqrt (* (* z 2.0) (fma t t 1.0))))
(* (sqrt (* z 2.0)) (* (pow t 2.0) (* 0.5 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 6e+18) {
tmp = t_1 * sqrt(((z * 2.0) * fma(t, t, 1.0)));
} else {
tmp = sqrt((z * 2.0)) * (pow(t, 2.0) * (0.5 * t_1));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 6e+18) tmp = Float64(t_1 * sqrt(Float64(Float64(z * 2.0) * fma(t, t, 1.0)))); else tmp = Float64(sqrt(Float64(z * 2.0)) * Float64((t ^ 2.0) * Float64(0.5 * t_1))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 6e+18], N[(t$95$1 * N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[t, 2.0], $MachinePrecision] * N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 6 \cdot 10^{+18}:\\
\;\;\;\;t_1 \cdot \sqrt{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left({t}^{2} \cdot \left(0.5 \cdot t_1\right)\right)\\
\end{array}
\end{array}
if t < 6e18Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
exp-sqrt99.7%
Simplified99.7%
associate-*r*99.7%
*-commutative99.7%
expm1-log1p-u60.5%
expm1-udef42.2%
Applied egg-rr42.2%
expm1-def60.5%
expm1-log1p99.7%
*-commutative99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in t around 0 87.8%
distribute-lft-out87.8%
*-commutative87.8%
Simplified87.8%
expm1-log1p-u86.2%
expm1-udef52.2%
+-commutative52.2%
fma-def52.2%
Applied egg-rr52.2%
expm1-def86.2%
expm1-log1p87.8%
*-commutative87.8%
fma-udef87.8%
*-commutative87.8%
distribute-lft1-in87.8%
associate-*l*87.8%
unpow287.8%
fma-def87.8%
Simplified87.8%
if 6e18 < t Initial program 98.2%
*-commutative98.2%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 86.5%
fma-neg86.5%
*-commutative86.5%
associate-*r*86.5%
*-commutative86.5%
fma-neg86.5%
Simplified86.5%
Final simplification87.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 6.5e+18)
(* (sqrt (* z 2.0)) t_1)
(if (<= t 3.5e+151)
(sqrt (* (* z 2.0) (pow t_1 2.0)))
(* t (* t_1 (* (sqrt z) (sqrt 2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 6.5e+18) {
tmp = sqrt((z * 2.0)) * t_1;
} else if (t <= 3.5e+151) {
tmp = sqrt(((z * 2.0) * pow(t_1, 2.0)));
} else {
tmp = t * (t_1 * (sqrt(z) * sqrt(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 = (x * 0.5d0) - y
if (t <= 6.5d+18) then
tmp = sqrt((z * 2.0d0)) * t_1
else if (t <= 3.5d+151) then
tmp = sqrt(((z * 2.0d0) * (t_1 ** 2.0d0)))
else
tmp = t * (t_1 * (sqrt(z) * sqrt(2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 6.5e+18) {
tmp = Math.sqrt((z * 2.0)) * t_1;
} else if (t <= 3.5e+151) {
tmp = Math.sqrt(((z * 2.0) * Math.pow(t_1, 2.0)));
} else {
tmp = t * (t_1 * (Math.sqrt(z) * Math.sqrt(2.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if t <= 6.5e+18: tmp = math.sqrt((z * 2.0)) * t_1 elif t <= 3.5e+151: tmp = math.sqrt(((z * 2.0) * math.pow(t_1, 2.0))) else: tmp = t * (t_1 * (math.sqrt(z) * math.sqrt(2.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 6.5e+18) tmp = Float64(sqrt(Float64(z * 2.0)) * t_1); elseif (t <= 3.5e+151) tmp = sqrt(Float64(Float64(z * 2.0) * (t_1 ^ 2.0))); else tmp = Float64(t * Float64(t_1 * Float64(sqrt(z) * sqrt(2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if (t <= 6.5e+18) tmp = sqrt((z * 2.0)) * t_1; elseif (t <= 3.5e+151) tmp = sqrt(((z * 2.0) * (t_1 ^ 2.0))); else tmp = t * (t_1 * (sqrt(z) * sqrt(2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 6.5e+18], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t, 3.5e+151], N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t * N[(t$95$1 * N[(N[Sqrt[z], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 6.5 \cdot 10^{+18}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot t_1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+151}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {t_1}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(t_1 \cdot \left(\sqrt{z} \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if t < 6.5e18Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
exp-sqrt99.7%
Simplified99.7%
Taylor expanded in t around 0 71.9%
if 6.5e18 < t < 3.5000000000000003e151Initial program 95.8%
*-commutative95.8%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 16.9%
*-commutative16.9%
associate-*l*16.9%
Simplified16.9%
add-sqr-sqrt6.3%
sqrt-unprod25.6%
swap-sqr25.6%
rem-square-sqrt25.6%
*-commutative25.6%
*-commutative25.6%
*-commutative25.6%
*-commutative25.6%
swap-sqr25.5%
add-sqr-sqrt25.5%
pow225.5%
*-commutative25.5%
fma-neg25.5%
Applied egg-rr25.5%
associate-*r*25.5%
*-commutative25.5%
fma-neg25.5%
Simplified25.5%
if 3.5000000000000003e151 < t Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
associate-*r*100.0%
*-commutative100.0%
expm1-log1p-u60.6%
expm1-udef60.6%
Applied egg-rr60.6%
expm1-def60.6%
expm1-log1p100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
distribute-lft-out100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 62.4%
associate-*l*51.2%
*-commutative51.2%
associate-*l*51.2%
*-commutative51.2%
Simplified51.2%
Final simplification64.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 4e+18)
(* (sqrt (* z 2.0)) t_1)
(if (<= t 4.2e+78)
(sqrt (* (* z 2.0) (pow t_1 2.0)))
(* (sqrt z) (* t_1 (* t (sqrt 2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 4e+18) {
tmp = sqrt((z * 2.0)) * t_1;
} else if (t <= 4.2e+78) {
tmp = sqrt(((z * 2.0) * pow(t_1, 2.0)));
} else {
tmp = sqrt(z) * (t_1 * (t * sqrt(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 = (x * 0.5d0) - y
if (t <= 4d+18) then
tmp = sqrt((z * 2.0d0)) * t_1
else if (t <= 4.2d+78) then
tmp = sqrt(((z * 2.0d0) * (t_1 ** 2.0d0)))
else
tmp = sqrt(z) * (t_1 * (t * sqrt(2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 4e+18) {
tmp = Math.sqrt((z * 2.0)) * t_1;
} else if (t <= 4.2e+78) {
tmp = Math.sqrt(((z * 2.0) * Math.pow(t_1, 2.0)));
} else {
tmp = Math.sqrt(z) * (t_1 * (t * Math.sqrt(2.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if t <= 4e+18: tmp = math.sqrt((z * 2.0)) * t_1 elif t <= 4.2e+78: tmp = math.sqrt(((z * 2.0) * math.pow(t_1, 2.0))) else: tmp = math.sqrt(z) * (t_1 * (t * math.sqrt(2.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 4e+18) tmp = Float64(sqrt(Float64(z * 2.0)) * t_1); elseif (t <= 4.2e+78) tmp = sqrt(Float64(Float64(z * 2.0) * (t_1 ^ 2.0))); else tmp = Float64(sqrt(z) * Float64(t_1 * Float64(t * sqrt(2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if (t <= 4e+18) tmp = sqrt((z * 2.0)) * t_1; elseif (t <= 4.2e+78) tmp = sqrt(((z * 2.0) * (t_1 ^ 2.0))); else tmp = sqrt(z) * (t_1 * (t * sqrt(2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 4e+18], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t, 4.2e+78], N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[z], $MachinePrecision] * N[(t$95$1 * N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 4 \cdot 10^{+18}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot t_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+78}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {t_1}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z} \cdot \left(t_1 \cdot \left(t \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if t < 4e18Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
exp-sqrt99.7%
Simplified99.7%
Taylor expanded in t around 0 71.9%
if 4e18 < t < 4.2000000000000002e78Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 14.2%
*-commutative14.2%
associate-*l*14.2%
Simplified14.2%
add-sqr-sqrt12.2%
sqrt-unprod36.8%
swap-sqr36.8%
rem-square-sqrt36.8%
*-commutative36.8%
*-commutative36.8%
*-commutative36.8%
*-commutative36.8%
swap-sqr36.8%
add-sqr-sqrt36.8%
pow236.8%
*-commutative36.8%
fma-neg36.8%
Applied egg-rr36.8%
associate-*r*36.8%
*-commutative36.8%
fma-neg36.8%
Simplified36.8%
if 4.2000000000000002e78 < t Initial program 97.8%
*-commutative97.8%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
associate-*r*97.8%
*-commutative97.8%
expm1-log1p-u52.2%
expm1-udef52.2%
Applied egg-rr52.2%
expm1-def52.2%
expm1-log1p100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 83.5%
distribute-lft-out83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in t around inf 56.4%
*-commutative56.4%
associate-*r*56.4%
*-commutative56.4%
Simplified56.4%
Final simplification67.6%
(FPCore (x y z t) :precision binary64 (* (exp (/ (* t t) 2.0)) (* (sqrt (* z 2.0)) (- (* x 0.5) y))))
double code(double x, double y, double z, double t) {
return exp(((t * t) / 2.0)) * (sqrt((z * 2.0)) * ((x * 0.5) - 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 = exp(((t * t) / 2.0d0)) * (sqrt((z * 2.0d0)) * ((x * 0.5d0) - y))
end function
public static double code(double x, double y, double z, double t) {
return Math.exp(((t * t) / 2.0)) * (Math.sqrt((z * 2.0)) * ((x * 0.5) - y));
}
def code(x, y, z, t): return math.exp(((t * t) / 2.0)) * (math.sqrt((z * 2.0)) * ((x * 0.5) - y))
function code(x, y, z, t) return Float64(exp(Float64(Float64(t * t) / 2.0)) * Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(x * 0.5) - y))) end
function tmp = code(x, y, z, t) tmp = exp(((t * t) / 2.0)) * (sqrt((z * 2.0)) * ((x * 0.5) - y)); end
code[x_, y_, z_, t_] := N[(N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{\frac{t \cdot t}{2}} \cdot \left(\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\right)
\end{array}
Initial program 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* z 2.0) (fma t t 1.0)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((z * 2.0) * fma(t, t, 1.0)));
}
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(z * 2.0) * fma(t, t, 1.0)))) end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[(t * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(z \cdot 2\right) \cdot \mathsf{fma}\left(t, t, 1\right)}
\end{array}
Initial program 99.4%
*-commutative99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
associate-*r*99.4%
*-commutative99.4%
expm1-log1p-u58.8%
expm1-udef44.5%
Applied egg-rr44.5%
expm1-def58.8%
expm1-log1p99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in t around 0 85.0%
distribute-lft-out85.0%
*-commutative85.0%
Simplified85.0%
expm1-log1p-u83.7%
expm1-udef57.3%
+-commutative57.3%
fma-def57.3%
Applied egg-rr57.3%
expm1-def83.7%
expm1-log1p85.0%
*-commutative85.0%
fma-udef85.0%
*-commutative85.0%
distribute-lft1-in85.0%
associate-*l*85.0%
unpow285.0%
fma-def85.0%
Simplified85.0%
Final simplification85.0%
(FPCore (x y z t)
:precision binary64
(if (<= t 3.5e+18)
(* (sqrt (* z 2.0)) (- (* x 0.5) y))
(if (or (<= t 2.15e+142) (not (<= t 1.7e+223)))
(sqrt (* z (* 0.5 (pow x 2.0))))
(sqrt (* (* z 2.0) (* y (- y x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e+18) {
tmp = sqrt((z * 2.0)) * ((x * 0.5) - y);
} else if ((t <= 2.15e+142) || !(t <= 1.7e+223)) {
tmp = sqrt((z * (0.5 * pow(x, 2.0))));
} else {
tmp = sqrt(((z * 2.0) * (y * (y - x))));
}
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 (t <= 3.5d+18) then
tmp = sqrt((z * 2.0d0)) * ((x * 0.5d0) - y)
else if ((t <= 2.15d+142) .or. (.not. (t <= 1.7d+223))) then
tmp = sqrt((z * (0.5d0 * (x ** 2.0d0))))
else
tmp = sqrt(((z * 2.0d0) * (y * (y - x))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e+18) {
tmp = Math.sqrt((z * 2.0)) * ((x * 0.5) - y);
} else if ((t <= 2.15e+142) || !(t <= 1.7e+223)) {
tmp = Math.sqrt((z * (0.5 * Math.pow(x, 2.0))));
} else {
tmp = Math.sqrt(((z * 2.0) * (y * (y - x))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3.5e+18: tmp = math.sqrt((z * 2.0)) * ((x * 0.5) - y) elif (t <= 2.15e+142) or not (t <= 1.7e+223): tmp = math.sqrt((z * (0.5 * math.pow(x, 2.0)))) else: tmp = math.sqrt(((z * 2.0) * (y * (y - x)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3.5e+18) tmp = Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(x * 0.5) - y)); elseif ((t <= 2.15e+142) || !(t <= 1.7e+223)) tmp = sqrt(Float64(z * Float64(0.5 * (x ^ 2.0)))); else tmp = sqrt(Float64(Float64(z * 2.0) * Float64(y * Float64(y - x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.5e+18) tmp = sqrt((z * 2.0)) * ((x * 0.5) - y); elseif ((t <= 2.15e+142) || ~((t <= 1.7e+223))) tmp = sqrt((z * (0.5 * (x ^ 2.0)))); else tmp = sqrt(((z * 2.0) * (y * (y - x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.5e+18], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 2.15e+142], N[Not[LessEqual[t, 1.7e+223]], $MachinePrecision]], N[Sqrt[N[(z * N[(0.5 * N[Power[x, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[(y * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{+18}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{+142} \lor \neg \left(t \leq 1.7 \cdot 10^{+223}\right):\\
\;\;\;\;\sqrt{z \cdot \left(0.5 \cdot {x}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot \left(y \cdot \left(y - x\right)\right)}\\
\end{array}
\end{array}
if t < 3.5e18Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
exp-sqrt99.7%
Simplified99.7%
Taylor expanded in t around 0 71.9%
if 3.5e18 < t < 2.15000000000000006e142 or 1.6999999999999999e223 < t Initial program 97.4%
*-commutative97.4%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 11.8%
*-commutative11.8%
associate-*l*11.8%
Simplified11.8%
add-sqr-sqrt7.3%
sqrt-unprod24.1%
swap-sqr24.1%
rem-square-sqrt24.1%
*-commutative24.1%
*-commutative24.1%
*-commutative24.1%
*-commutative24.1%
swap-sqr24.0%
add-sqr-sqrt24.0%
pow224.0%
*-commutative24.0%
fma-neg24.0%
Applied egg-rr24.0%
associate-*r*24.0%
*-commutative24.0%
fma-neg24.0%
Simplified24.0%
Taylor expanded in x around inf 21.6%
associate-*r*21.6%
*-commutative21.6%
Simplified21.6%
if 2.15000000000000006e142 < t < 1.6999999999999999e223Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 20.1%
*-commutative20.1%
associate-*l*20.1%
Simplified20.1%
add-sqr-sqrt7.6%
sqrt-unprod28.6%
swap-sqr28.6%
rem-square-sqrt28.6%
*-commutative28.6%
*-commutative28.6%
*-commutative28.6%
*-commutative28.6%
swap-sqr28.6%
add-sqr-sqrt28.6%
pow228.6%
*-commutative28.6%
fma-neg28.6%
Applied egg-rr28.6%
associate-*r*28.6%
*-commutative28.6%
fma-neg28.6%
Simplified28.6%
Taylor expanded in x around 0 22.9%
+-commutative22.9%
unpow222.9%
associate-*r*22.9%
distribute-rgt-out22.9%
mul-1-neg22.9%
Simplified22.9%
Final simplification60.8%
(FPCore (x y z t)
:precision binary64
(if (<= t 7.2e+18)
(* (sqrt (* z 2.0)) (- (* x 0.5) y))
(if (or (<= t 1.6e+129) (not (<= t 1.8e+224)))
(sqrt (* z (* 0.5 (pow x 2.0))))
(sqrt (* (* z 2.0) (pow y 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 7.2e+18) {
tmp = sqrt((z * 2.0)) * ((x * 0.5) - y);
} else if ((t <= 1.6e+129) || !(t <= 1.8e+224)) {
tmp = sqrt((z * (0.5 * pow(x, 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) :: tmp
if (t <= 7.2d+18) then
tmp = sqrt((z * 2.0d0)) * ((x * 0.5d0) - y)
else if ((t <= 1.6d+129) .or. (.not. (t <= 1.8d+224))) then
tmp = sqrt((z * (0.5d0 * (x ** 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 tmp;
if (t <= 7.2e+18) {
tmp = Math.sqrt((z * 2.0)) * ((x * 0.5) - y);
} else if ((t <= 1.6e+129) || !(t <= 1.8e+224)) {
tmp = Math.sqrt((z * (0.5 * Math.pow(x, 2.0))));
} else {
tmp = Math.sqrt(((z * 2.0) * Math.pow(y, 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 7.2e+18: tmp = math.sqrt((z * 2.0)) * ((x * 0.5) - y) elif (t <= 1.6e+129) or not (t <= 1.8e+224): tmp = math.sqrt((z * (0.5 * math.pow(x, 2.0)))) else: tmp = math.sqrt(((z * 2.0) * math.pow(y, 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 7.2e+18) tmp = Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(x * 0.5) - y)); elseif ((t <= 1.6e+129) || !(t <= 1.8e+224)) tmp = sqrt(Float64(z * Float64(0.5 * (x ^ 2.0)))); else tmp = 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 (t <= 7.2e+18) tmp = sqrt((z * 2.0)) * ((x * 0.5) - y); elseif ((t <= 1.6e+129) || ~((t <= 1.8e+224))) tmp = sqrt((z * (0.5 * (x ^ 2.0)))); else tmp = sqrt(((z * 2.0) * (y ^ 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 7.2e+18], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1.6e+129], N[Not[LessEqual[t, 1.8e+224]], $MachinePrecision]], N[Sqrt[N[(z * N[(0.5 * N[Power[x, 2.0], $MachinePrecision]), $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}\;t \leq 7.2 \cdot 10^{+18}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+129} \lor \neg \left(t \leq 1.8 \cdot 10^{+224}\right):\\
\;\;\;\;\sqrt{z \cdot \left(0.5 \cdot {x}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {y}^{2}}\\
\end{array}
\end{array}
if t < 7.2e18Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
exp-sqrt99.7%
Simplified99.7%
Taylor expanded in t around 0 71.9%
if 7.2e18 < t < 1.6000000000000001e129 or 1.8e224 < t Initial program 97.3%
*-commutative97.3%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 12.3%
*-commutative12.3%
associate-*l*12.3%
Simplified12.3%
add-sqr-sqrt7.7%
sqrt-unprod25.3%
swap-sqr25.3%
rem-square-sqrt25.3%
*-commutative25.3%
*-commutative25.3%
*-commutative25.3%
*-commutative25.3%
swap-sqr25.3%
add-sqr-sqrt25.3%
pow225.3%
*-commutative25.3%
fma-neg25.3%
Applied egg-rr25.3%
associate-*r*25.3%
*-commutative25.3%
fma-neg25.3%
Simplified25.3%
Taylor expanded in x around inf 22.7%
associate-*r*22.7%
*-commutative22.7%
Simplified22.7%
if 1.6000000000000001e129 < t < 1.8e224Initial program 100.0%
*-commutative100.0%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 18.4%
Taylor expanded in x around 0 8.0%
mul-1-neg8.0%
associate-*l*8.0%
*-commutative8.0%
distribute-rgt-neg-in8.0%
*-commutative8.0%
Simplified8.0%
add-sqr-sqrt1.7%
sqrt-unprod20.8%
*-commutative20.8%
*-commutative20.8%
swap-sqr20.8%
*-commutative20.8%
sqrt-prod20.8%
*-commutative20.8%
sqrt-prod20.8%
sqr-neg20.8%
add-sqr-sqrt20.8%
*-commutative20.8%
pow220.8%
Applied egg-rr20.8%
*-commutative20.8%
*-commutative20.8%
Simplified20.8%
Final simplification60.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 2.95e+18)
(* (sqrt (* z 2.0)) t_1)
(sqrt (* (* z 2.0) (pow t_1 2.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 2.95e+18) {
tmp = sqrt((z * 2.0)) * t_1;
} else {
tmp = sqrt(((z * 2.0) * pow(t_1, 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 = (x * 0.5d0) - y
if (t <= 2.95d+18) then
tmp = sqrt((z * 2.0d0)) * t_1
else
tmp = sqrt(((z * 2.0d0) * (t_1 ** 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t <= 2.95e+18) {
tmp = Math.sqrt((z * 2.0)) * t_1;
} else {
tmp = Math.sqrt(((z * 2.0) * Math.pow(t_1, 2.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if t <= 2.95e+18: tmp = math.sqrt((z * 2.0)) * t_1 else: tmp = math.sqrt(((z * 2.0) * math.pow(t_1, 2.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t <= 2.95e+18) tmp = Float64(sqrt(Float64(z * 2.0)) * t_1); else tmp = sqrt(Float64(Float64(z * 2.0) * (t_1 ^ 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if (t <= 2.95e+18) tmp = sqrt((z * 2.0)) * t_1; else tmp = sqrt(((z * 2.0) * (t_1 ^ 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t, 2.95e+18], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 2.95 \cdot 10^{+18}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {t_1}^{2}}\\
\end{array}
\end{array}
if t < 2.95e18Initial program 99.7%
*-commutative99.7%
associate-*l*99.7%
exp-sqrt99.7%
Simplified99.7%
Taylor expanded in t around 0 71.9%
if 2.95e18 < t Initial program 98.2%
*-commutative98.2%
associate-*l*100.0%
exp-sqrt100.0%
Simplified100.0%
Taylor expanded in t around 0 14.4%
*-commutative14.4%
associate-*l*14.4%
Simplified14.4%
add-sqr-sqrt7.4%
sqrt-unprod25.5%
swap-sqr25.5%
rem-square-sqrt25.5%
*-commutative25.5%
*-commutative25.5%
*-commutative25.5%
*-commutative25.5%
swap-sqr25.5%
add-sqr-sqrt25.5%
pow225.5%
*-commutative25.5%
fma-neg25.5%
Applied egg-rr25.5%
associate-*r*25.5%
*-commutative25.5%
fma-neg25.5%
Simplified25.5%
Final simplification61.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (or (<= y -2.1e+89) (not (<= y 7.2e-38)))
(* t_1 (- y))
(* t_1 (* x 0.5)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if ((y <= -2.1e+89) || !(y <= 7.2e-38)) {
tmp = t_1 * -y;
} else {
tmp = t_1 * (x * 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) :: t_1
real(8) :: tmp
t_1 = sqrt((z * 2.0d0))
if ((y <= (-2.1d+89)) .or. (.not. (y <= 7.2d-38))) then
tmp = t_1 * -y
else
tmp = t_1 * (x * 0.5d0)
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 <= -2.1e+89) || !(y <= 7.2e-38)) {
tmp = t_1 * -y;
} else {
tmp = t_1 * (x * 0.5);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if (y <= -2.1e+89) or not (y <= 7.2e-38): tmp = t_1 * -y else: tmp = t_1 * (x * 0.5) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if ((y <= -2.1e+89) || !(y <= 7.2e-38)) tmp = Float64(t_1 * Float64(-y)); else tmp = Float64(t_1 * Float64(x * 0.5)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if ((y <= -2.1e+89) || ~((y <= 7.2e-38))) tmp = t_1 * -y; else tmp = t_1 * (x * 0.5); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y, -2.1e+89], N[Not[LessEqual[y, 7.2e-38]], $MachinePrecision]], N[(t$95$1 * (-y)), $MachinePrecision], N[(t$95$1 * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+89} \lor \neg \left(y \leq 7.2 \cdot 10^{-38}\right):\\
\;\;\;\;t_1 \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if y < -2.09999999999999986e89 or 7.2000000000000001e-38 < y Initial program 99.8%
*-commutative99.8%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 58.9%
Taylor expanded in x around 0 46.1%
mul-1-neg46.1%
associate-*l*46.1%
*-commutative46.1%
distribute-rgt-neg-in46.1%
*-commutative46.1%
Simplified46.1%
distribute-rgt-neg-out46.1%
neg-sub046.1%
sqrt-unprod46.3%
Applied egg-rr46.3%
neg-sub046.3%
distribute-lft-neg-in46.3%
*-commutative46.3%
Simplified46.3%
if -2.09999999999999986e89 < y < 7.2000000000000001e-38Initial program 99.1%
*-commutative99.1%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 59.1%
*-commutative59.1%
associate-*l*59.1%
Simplified59.1%
Taylor expanded in x around inf 49.4%
associate-*r*49.4%
*-commutative49.4%
Simplified49.4%
expm1-log1p-u30.3%
expm1-udef18.1%
*-commutative18.1%
*-commutative18.1%
associate-*l*18.1%
sqrt-prod18.1%
*-commutative18.1%
Applied egg-rr18.1%
expm1-def30.4%
expm1-log1p49.6%
*-commutative49.6%
Simplified49.6%
Final simplification48.1%
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (- (* x 0.5) y)))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * ((x * 0.5) - 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)) * ((x * 0.5d0) - y)
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * ((x * 0.5) - y);
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * ((x * 0.5) - y)
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(x * 0.5) - y)) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * ((x * 0.5) - y); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(x \cdot 0.5 - y\right)
\end{array}
Initial program 99.4%
*-commutative99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 59.1%
Final simplification59.1%
(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.4%
*-commutative99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 59.1%
Taylor expanded in x around 0 27.2%
mul-1-neg27.2%
associate-*l*27.2%
*-commutative27.2%
distribute-rgt-neg-in27.2%
*-commutative27.2%
Simplified27.2%
distribute-rgt-neg-out27.2%
neg-sub027.2%
sqrt-unprod27.2%
Applied egg-rr27.2%
neg-sub027.2%
distribute-lft-neg-in27.2%
*-commutative27.2%
Simplified27.2%
Final simplification27.2%
(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)) * 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 y
\end{array}
Initial program 99.4%
*-commutative99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 59.1%
Taylor expanded in x around 0 27.2%
mul-1-neg27.2%
associate-*l*27.2%
*-commutative27.2%
distribute-rgt-neg-in27.2%
*-commutative27.2%
Simplified27.2%
expm1-log1p-u17.2%
expm1-udef10.2%
Applied egg-rr2.2%
expm1-def2.1%
expm1-log1p2.3%
*-commutative2.3%
Simplified2.3%
Final simplification2.3%
(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 2023321
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
:herbie-target
(* (* (- (* 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))))