
(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 8 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 (* (exp (pow t 2.0)) (* 2.0 z)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt((exp(pow(t, 2.0)) * (2.0 * z)));
}
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((exp((t ** 2.0d0)) * (2.0d0 * z)))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt((Math.exp(Math.pow(t, 2.0)) * (2.0 * z)));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt((math.exp(math.pow(t, 2.0)) * (2.0 * z)))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(exp((t ^ 2.0)) * Float64(2.0 * z)))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt((exp((t ^ 2.0)) * (2.0 * z))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[Exp[N[Power[t, 2.0], $MachinePrecision]], $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{e^{{t}^{2}} \cdot \left(2 \cdot z\right)}
\end{array}
Initial program 99.0%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
pow199.8%
sqrt-unprod99.8%
associate-*l*99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow199.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (<= t 2.8e-5) (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (* (sqrt 2.0) (* x (* (+ -0.5 (/ y x)) (- (sqrt z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.8e-5) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else {
tmp = sqrt(2.0) * (x * ((-0.5 + (y / x)) * -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 (t <= 2.8d-5) then
tmp = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
else
tmp = sqrt(2.0d0) * (x * (((-0.5d0) + (y / x)) * -sqrt(z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.8e-5) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else {
tmp = Math.sqrt(2.0) * (x * ((-0.5 + (y / x)) * -Math.sqrt(z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.8e-5: tmp = ((x * 0.5) - y) * math.sqrt((2.0 * z)) else: tmp = math.sqrt(2.0) * (x * ((-0.5 + (y / x)) * -math.sqrt(z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.8e-5) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); else tmp = Float64(sqrt(2.0) * Float64(x * Float64(Float64(-0.5 + Float64(y / x)) * Float64(-sqrt(z))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2.8e-5) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); else tmp = sqrt(2.0) * (x * ((-0.5 + (y / x)) * -sqrt(z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.8e-5], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(x * N[(N[(-0.5 + N[(y / x), $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[z], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.8 \cdot 10^{-5}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(x \cdot \left(\left(-0.5 + \frac{y}{x}\right) \cdot \left(-\sqrt{z}\right)\right)\right)\\
\end{array}
\end{array}
if t < 2.79999999999999996e-5Initial program 99.3%
Taylor expanded in t around 0 71.9%
associate-*r*71.9%
sqrt-prod72.1%
sub-neg72.1%
distribute-lft-in71.1%
*-commutative71.1%
*-commutative71.1%
*-commutative71.1%
Applied egg-rr71.1%
distribute-lft-out72.1%
sub-neg72.1%
*-commutative72.1%
*-commutative72.1%
Simplified72.1%
if 2.79999999999999996e-5 < t Initial program 98.4%
add-sqr-sqrt48.4%
sqrt-unprod46.8%
*-commutative46.8%
*-commutative46.8%
swap-sqr46.8%
add-sqr-sqrt46.8%
pow246.8%
Applied egg-rr46.8%
*-commutative46.8%
*-commutative46.8%
*-commutative46.8%
Simplified46.8%
sqrt-prod46.8%
*-commutative46.8%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
add-sqr-sqrt98.4%
associate-*r*98.4%
*-commutative98.4%
pow1/298.4%
*-commutative98.4%
sqrt-pow198.4%
metadata-eval98.4%
pow1/298.4%
*-commutative98.4%
sqrt-pow198.4%
metadata-eval98.4%
Applied egg-rr98.4%
associate-*l*98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in t around 0 10.8%
*-commutative10.8%
fma-neg10.8%
associate-*l*10.8%
*-commutative10.8%
fma-neg10.8%
Simplified10.8%
Taylor expanded in x around -inf 29.0%
mul-1-neg29.0%
*-commutative29.0%
distribute-rgt-neg-in29.0%
distribute-rgt-out29.0%
Simplified29.0%
Final simplification61.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t 1.22e+30)
(* t_1 (sqrt (* 2.0 z)))
(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 <= 1.22e+30) {
tmp = t_1 * sqrt((2.0 * z));
} 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 <= 1.22d+30) then
tmp = t_1 * sqrt((2.0d0 * z))
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 <= 1.22e+30) {
tmp = t_1 * Math.sqrt((2.0 * z));
} 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 <= 1.22e+30: tmp = t_1 * math.sqrt((2.0 * z)) 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 <= 1.22e+30) tmp = Float64(t_1 * sqrt(Float64(2.0 * z))); else tmp = sqrt(Float64(z * Float64(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 <= 1.22e+30) tmp = t_1 * sqrt((2.0 * z)); 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, 1.22e+30], N[(t$95$1 * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(z * N[(2.0 * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq 1.22 \cdot 10^{+30}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z \cdot \left(2 \cdot {t\_1}^{2}\right)}\\
\end{array}
\end{array}
if t < 1.22e30Initial program 99.3%
Taylor expanded in t around 0 71.5%
associate-*r*71.5%
sqrt-prod71.7%
sub-neg71.7%
distribute-lft-in70.7%
*-commutative70.7%
*-commutative70.7%
*-commutative70.7%
Applied egg-rr70.7%
distribute-lft-out71.7%
sub-neg71.7%
*-commutative71.7%
*-commutative71.7%
Simplified71.7%
if 1.22e30 < t Initial program 98.3%
Taylor expanded in t around 0 8.0%
associate-*r*8.0%
sqrt-prod8.0%
*-commutative8.0%
*-commutative8.0%
add-sqr-sqrt3.8%
unpow23.8%
add-sqr-sqrt3.8%
sqrt-prod23.3%
unpow223.3%
add-sqr-sqrt23.3%
*-commutative23.3%
sqrt-prod23.3%
*-commutative23.3%
associate-*r*23.3%
unpow223.3%
Applied egg-rr25.1%
Final simplification61.2%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((2.0 * z))) * 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((2.0d0 * z))) * 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((2.0 * z))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((2.0 * z))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((2.0 * z))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $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{2 \cdot z}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
Initial program 99.0%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (<= t 39000000.0) (* y (- (sqrt (* 2.0 z)))) (sqrt (* z (* 2.0 (* y (- y x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 39000000.0) {
tmp = y * -sqrt((2.0 * z));
} 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 <= 39000000.0d0) then
tmp = y * -sqrt((2.0d0 * z))
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 <= 39000000.0) {
tmp = y * -Math.sqrt((2.0 * z));
} else {
tmp = Math.sqrt((z * (2.0 * (y * (y - x)))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 39000000.0: tmp = y * -math.sqrt((2.0 * z)) else: tmp = math.sqrt((z * (2.0 * (y * (y - x))))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 39000000.0) tmp = Float64(y * Float64(-sqrt(Float64(2.0 * z)))); else tmp = sqrt(Float64(z * Float64(2.0 * Float64(y * Float64(y - x))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 39000000.0) tmp = y * -sqrt((2.0 * z)); else tmp = sqrt((z * (2.0 * (y * (y - x))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 39000000.0], N[(y * (-N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[Sqrt[N[(z * N[(2.0 * N[(y * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 39000000:\\
\;\;\;\;y \cdot \left(-\sqrt{2 \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{z \cdot \left(2 \cdot \left(y \cdot \left(y - x\right)\right)\right)}\\
\end{array}
\end{array}
if t < 3.9e7Initial program 99.3%
Taylor expanded in t around 0 72.0%
Taylor expanded in x around 0 37.9%
associate-*r*37.9%
mul-1-neg37.9%
distribute-lft-neg-out37.9%
*-commutative37.9%
Simplified37.9%
distribute-rgt-neg-out37.9%
distribute-lft-neg-out37.9%
*-commutative37.9%
add-sqr-sqrt21.2%
sqrt-unprod19.1%
sqr-neg19.1%
sqrt-unprod0.7%
add-sqr-sqrt2.2%
associate-*l*2.2%
sqrt-prod2.2%
add-sqr-sqrt0.7%
sqrt-unprod19.1%
sqr-neg19.1%
sqrt-unprod21.2%
add-sqr-sqrt38.1%
Applied egg-rr38.1%
distribute-rgt-neg-in38.1%
*-commutative38.1%
Simplified38.1%
if 3.9e7 < t Initial program 98.4%
Taylor expanded in t around 0 9.3%
associate-*r*9.3%
sqrt-prod9.3%
*-commutative9.3%
*-commutative9.3%
add-sqr-sqrt3.7%
unpow23.7%
add-sqr-sqrt3.7%
sqrt-prod22.2%
unpow222.2%
add-sqr-sqrt22.2%
*-commutative22.2%
sqrt-prod22.2%
*-commutative22.2%
associate-*r*22.2%
unpow222.2%
Applied egg-rr24.0%
Taylor expanded in x around 0 17.5%
+-commutative17.5%
unpow217.5%
associate-*r*17.5%
distribute-rgt-in17.5%
mul-1-neg17.5%
unsub-neg17.5%
Simplified17.5%
Final simplification33.2%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* 2.0 z))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt((2.0 * z));
}
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((2.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt((2.0 * z));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt((2.0 * z))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}
\end{array}
Initial program 99.0%
Taylor expanded in t around 0 57.1%
associate-*r*57.1%
sqrt-prod57.3%
sub-neg57.3%
distribute-lft-in56.5%
*-commutative56.5%
*-commutative56.5%
*-commutative56.5%
Applied egg-rr56.5%
distribute-lft-out57.3%
sub-neg57.3%
*-commutative57.3%
*-commutative57.3%
Simplified57.3%
Final simplification57.3%
(FPCore (x y z t) :precision binary64 (* y (- (sqrt (* 2.0 z)))))
double code(double x, double y, double z, double t) {
return y * -sqrt((2.0 * z));
}
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 = y * -sqrt((2.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return y * -Math.sqrt((2.0 * z));
}
def code(x, y, z, t): return y * -math.sqrt((2.0 * z))
function code(x, y, z, t) return Float64(y * Float64(-sqrt(Float64(2.0 * z)))) end
function tmp = code(x, y, z, t) tmp = y * -sqrt((2.0 * z)); end
code[x_, y_, z_, t_] := N[(y * (-N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-\sqrt{2 \cdot z}\right)
\end{array}
Initial program 99.0%
Taylor expanded in t around 0 57.1%
Taylor expanded in x around 0 30.5%
associate-*r*30.5%
mul-1-neg30.5%
distribute-lft-neg-out30.5%
*-commutative30.5%
Simplified30.5%
distribute-rgt-neg-out30.5%
distribute-lft-neg-out30.5%
*-commutative30.5%
add-sqr-sqrt16.9%
sqrt-unprod18.3%
sqr-neg18.3%
sqrt-unprod0.7%
add-sqr-sqrt1.9%
associate-*l*1.9%
sqrt-prod1.9%
add-sqr-sqrt0.7%
sqrt-unprod18.4%
sqr-neg18.4%
sqrt-unprod17.0%
add-sqr-sqrt30.6%
Applied egg-rr30.6%
distribute-rgt-neg-in30.6%
*-commutative30.6%
Simplified30.6%
Final simplification30.6%
(FPCore (x y z t) :precision binary64 (* y (sqrt (* 2.0 z))))
double code(double x, double y, double z, double t) {
return y * sqrt((2.0 * z));
}
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 = y * sqrt((2.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return y * Math.sqrt((2.0 * z));
}
def code(x, y, z, t): return y * math.sqrt((2.0 * z))
function code(x, y, z, t) return Float64(y * sqrt(Float64(2.0 * z))) end
function tmp = code(x, y, z, t) tmp = y * sqrt((2.0 * z)); end
code[x_, y_, z_, t_] := N[(y * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \sqrt{2 \cdot z}
\end{array}
Initial program 99.0%
Taylor expanded in t around 0 57.1%
Taylor expanded in x around 0 30.5%
associate-*r*30.5%
mul-1-neg30.5%
distribute-lft-neg-out30.5%
*-commutative30.5%
Simplified30.5%
pow130.5%
*-commutative30.5%
associate-*l*30.5%
sqrt-prod30.6%
add-sqr-sqrt13.5%
sqrt-unprod15.3%
sqr-neg15.3%
sqrt-unprod1.2%
add-sqr-sqrt1.9%
Applied egg-rr1.9%
unpow11.9%
*-commutative1.9%
Simplified1.9%
Final simplification1.9%
(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 2024055
(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))))