
(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 12 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}
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (* (- (* x 0.5) y) (* (sqrt (pow (exp (* 0.5 t_m)) (* 2.0 t_m))) (sqrt (* z 2.0)))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
return ((x * 0.5) - y) * (sqrt(pow(exp((0.5 * t_m)), (2.0 * t_m))) * sqrt((z * 2.0)));
}
t_m = abs(t)
real(8) function code(x, y, z, t_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = ((x * 0.5d0) - y) * (sqrt((exp((0.5d0 * t_m)) ** (2.0d0 * t_m))) * sqrt((z * 2.0d0)))
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
return ((x * 0.5) - y) * (Math.sqrt(Math.pow(Math.exp((0.5 * t_m)), (2.0 * t_m))) * Math.sqrt((z * 2.0)));
}
t_m = math.fabs(t) def code(x, y, z, t_m): return ((x * 0.5) - y) * (math.sqrt(math.pow(math.exp((0.5 * t_m)), (2.0 * t_m))) * math.sqrt((z * 2.0)))
t_m = abs(t) function code(x, y, z, t_m) return Float64(Float64(Float64(x * 0.5) - y) * Float64(sqrt((exp(Float64(0.5 * t_m)) ^ Float64(2.0 * t_m))) * sqrt(Float64(z * 2.0)))) end
t_m = abs(t); function tmp = code(x, y, z, t_m) tmp = ((x * 0.5) - y) * (sqrt((exp((0.5 * t_m)) ^ (2.0 * t_m))) * sqrt((z * 2.0))); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(N[Sqrt[N[Power[N[Exp[N[(0.5 * t$95$m), $MachinePrecision]], $MachinePrecision], N[(2.0 * t$95$m), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\left(x \cdot 0.5 - y\right) \cdot \left(\sqrt{{\left(e^{0.5 \cdot t\_m}\right)}^{\left(2 \cdot t\_m\right)}} \cdot \sqrt{z \cdot 2}\right)
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
add-sqr-sqrt99.8%
unpow-prod-down99.8%
Applied egg-rr99.8%
pow-sqr99.8%
*-commutative99.8%
Simplified99.8%
pow1/299.8%
add-exp-log99.8%
log-pow99.8%
add-log-exp99.8%
Applied egg-rr99.8%
Final simplification99.8%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* z 2.0) (exp (pow t_m 2.0))))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
return ((x * 0.5) - y) * sqrt(((z * 2.0) * exp(pow(t_m, 2.0))));
}
t_m = abs(t)
real(8) function code(x, y, z, t_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = ((x * 0.5d0) - y) * sqrt(((z * 2.0d0) * exp((t_m ** 2.0d0))))
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
return ((x * 0.5) - y) * Math.sqrt(((z * 2.0) * Math.exp(Math.pow(t_m, 2.0))));
}
t_m = math.fabs(t) def code(x, y, z, t_m): return ((x * 0.5) - y) * math.sqrt(((z * 2.0) * math.exp(math.pow(t_m, 2.0))))
t_m = abs(t) function code(x, y, z, t_m) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(z * 2.0) * exp((t_m ^ 2.0))))) end
t_m = abs(t); function tmp = code(x, y, z, t_m) tmp = ((x * 0.5) - y) * sqrt(((z * 2.0) * exp((t_m ^ 2.0)))); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Exp[N[Power[t$95$m, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(z \cdot 2\right) \cdot e^{{t\_m}^{2}}}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Final simplification99.8%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* z 2.0) (pow (exp t_m) t_m)))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
return ((x * 0.5) - y) * sqrt(((z * 2.0) * pow(exp(t_m), t_m)));
}
t_m = abs(t)
real(8) function code(x, y, z, t_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = ((x * 0.5d0) - y) * sqrt(((z * 2.0d0) * (exp(t_m) ** t_m)))
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
return ((x * 0.5) - y) * Math.sqrt(((z * 2.0) * Math.pow(Math.exp(t_m), t_m)));
}
t_m = math.fabs(t) def code(x, y, z, t_m): return ((x * 0.5) - y) * math.sqrt(((z * 2.0) * math.pow(math.exp(t_m), t_m)))
t_m = abs(t) function code(x, y, z, t_m) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(z * 2.0) * (exp(t_m) ^ t_m)))) end
t_m = abs(t); function tmp = code(x, y, z, t_m) tmp = ((x * 0.5) - y) * sqrt(((z * 2.0) * (exp(t_m) ^ t_m))); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[N[Exp[t$95$m], $MachinePrecision], t$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(z \cdot 2\right) \cdot {\left(e^{t\_m}\right)}^{t\_m}}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
unpow299.8%
exp-prod99.8%
Applied egg-rr99.8%
Final simplification99.8%
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t_m 24.0)
(* t_1 (sqrt (* z 2.0)))
(if (<= t_m 2.1e+80)
(sqrt (* (* z 2.0) (pow t_1 2.0)))
(* t_1 (sqrt (* 2.0 (* z (pow t_m 2.0)))))))))t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t_m <= 24.0) {
tmp = t_1 * sqrt((z * 2.0));
} else if (t_m <= 2.1e+80) {
tmp = sqrt(((z * 2.0) * pow(t_1, 2.0)));
} else {
tmp = t_1 * sqrt((2.0 * (z * pow(t_m, 2.0))));
}
return tmp;
}
t_m = abs(t)
real(8) function code(x, y, z, t_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 0.5d0) - y
if (t_m <= 24.0d0) then
tmp = t_1 * sqrt((z * 2.0d0))
else if (t_m <= 2.1d+80) then
tmp = sqrt(((z * 2.0d0) * (t_1 ** 2.0d0)))
else
tmp = t_1 * sqrt((2.0d0 * (z * (t_m ** 2.0d0))))
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
double t_1 = (x * 0.5) - y;
double tmp;
if (t_m <= 24.0) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else if (t_m <= 2.1e+80) {
tmp = Math.sqrt(((z * 2.0) * Math.pow(t_1, 2.0)));
} else {
tmp = t_1 * Math.sqrt((2.0 * (z * Math.pow(t_m, 2.0))));
}
return tmp;
}
t_m = math.fabs(t) def code(x, y, z, t_m): t_1 = (x * 0.5) - y tmp = 0 if t_m <= 24.0: tmp = t_1 * math.sqrt((z * 2.0)) elif t_m <= 2.1e+80: tmp = math.sqrt(((z * 2.0) * math.pow(t_1, 2.0))) else: tmp = t_1 * math.sqrt((2.0 * (z * math.pow(t_m, 2.0)))) return tmp
t_m = abs(t) function code(x, y, z, t_m) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (t_m <= 24.0) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); elseif (t_m <= 2.1e+80) tmp = sqrt(Float64(Float64(z * 2.0) * (t_1 ^ 2.0))); else tmp = Float64(t_1 * sqrt(Float64(2.0 * Float64(z * (t_m ^ 2.0))))); end return tmp end
t_m = abs(t); function tmp_2 = code(x, y, z, t_m) t_1 = (x * 0.5) - y; tmp = 0.0; if (t_m <= 24.0) tmp = t_1 * sqrt((z * 2.0)); elseif (t_m <= 2.1e+80) tmp = sqrt(((z * 2.0) * (t_1 ^ 2.0))); else tmp = t_1 * sqrt((2.0 * (z * (t_m ^ 2.0)))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
code[x_, y_, z_, t$95$m_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[t$95$m, 24.0], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.1e+80], N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(2.0 * N[(z * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t\_m \leq 24:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{elif}\;t\_m \leq 2.1 \cdot 10^{+80}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {t\_1}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{2 \cdot \left(z \cdot {t\_m}^{2}\right)}\\
\end{array}
\end{array}
if t < 24Initial program 99.2%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
sqrt-unprod99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
Taylor expanded in t around 0 71.7%
if 24 < t < 2.10000000000000001e80Initial program 100.0%
Taylor expanded in t around 0 4.3%
associate-*r*4.3%
sqrt-prod4.3%
*-commutative4.3%
*-commutative4.3%
add-sqr-sqrt2.4%
sqrt-unprod16.4%
*-commutative16.4%
sqrt-prod16.4%
*-commutative16.4%
associate-*r*16.4%
*-commutative16.4%
sqrt-prod16.4%
*-commutative16.4%
associate-*r*16.4%
swap-sqr16.3%
Applied egg-rr16.3%
associate-*r*16.3%
*-commutative16.3%
*-commutative16.3%
Simplified16.3%
if 2.10000000000000001e80 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
sqrt-unprod100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 83.8%
distribute-lft-out83.8%
distribute-rgt1-in83.8%
unpow283.8%
fma-define83.8%
Simplified83.8%
Taylor expanded in t around inf 83.8%
Final simplification69.9%
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* z 2.0))))
(if (<= t_m 27.5)
(* t_1 t_2)
(if (<= t_m 4.7e+73)
(sqrt (* (* z 2.0) (pow t_1 2.0)))
(* t_2 (* t_1 t_m))))))t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
double t_1 = (x * 0.5) - y;
double t_2 = sqrt((z * 2.0));
double tmp;
if (t_m <= 27.5) {
tmp = t_1 * t_2;
} else if (t_m <= 4.7e+73) {
tmp = sqrt(((z * 2.0) * pow(t_1, 2.0)));
} else {
tmp = t_2 * (t_1 * t_m);
}
return tmp;
}
t_m = abs(t)
real(8) function code(x, y, z, t_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 0.5d0) - y
t_2 = sqrt((z * 2.0d0))
if (t_m <= 27.5d0) then
tmp = t_1 * t_2
else if (t_m <= 4.7d+73) then
tmp = sqrt(((z * 2.0d0) * (t_1 ** 2.0d0)))
else
tmp = t_2 * (t_1 * t_m)
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
double t_1 = (x * 0.5) - y;
double t_2 = Math.sqrt((z * 2.0));
double tmp;
if (t_m <= 27.5) {
tmp = t_1 * t_2;
} else if (t_m <= 4.7e+73) {
tmp = Math.sqrt(((z * 2.0) * Math.pow(t_1, 2.0)));
} else {
tmp = t_2 * (t_1 * t_m);
}
return tmp;
}
t_m = math.fabs(t) def code(x, y, z, t_m): t_1 = (x * 0.5) - y t_2 = math.sqrt((z * 2.0)) tmp = 0 if t_m <= 27.5: tmp = t_1 * t_2 elif t_m <= 4.7e+73: tmp = math.sqrt(((z * 2.0) * math.pow(t_1, 2.0))) else: tmp = t_2 * (t_1 * t_m) return tmp
t_m = abs(t) function code(x, y, z, t_m) t_1 = Float64(Float64(x * 0.5) - y) t_2 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (t_m <= 27.5) tmp = Float64(t_1 * t_2); elseif (t_m <= 4.7e+73) tmp = sqrt(Float64(Float64(z * 2.0) * (t_1 ^ 2.0))); else tmp = Float64(t_2 * Float64(t_1 * t_m)); end return tmp end
t_m = abs(t); function tmp_2 = code(x, y, z, t_m) t_1 = (x * 0.5) - y; t_2 = sqrt((z * 2.0)); tmp = 0.0; if (t_m <= 27.5) tmp = t_1 * t_2; elseif (t_m <= 4.7e+73) tmp = sqrt(((z * 2.0) * (t_1 ^ 2.0))); else tmp = t_2 * (t_1 * t_m); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
code[x_, y_, z_, t$95$m_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$m, 27.5], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[t$95$m, 4.7e+73], N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$2 * N[(t$95$1 * t$95$m), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t\_m \leq 27.5:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;t\_m \leq 4.7 \cdot 10^{+73}:\\
\;\;\;\;\sqrt{\left(z \cdot 2\right) \cdot {t\_1}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot t\_m\right)\\
\end{array}
\end{array}
if t < 27.5Initial program 99.2%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
sqrt-unprod99.7%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
Taylor expanded in t around 0 71.7%
if 27.5 < t < 4.7000000000000002e73Initial program 100.0%
Taylor expanded in t around 0 4.2%
associate-*r*4.2%
sqrt-prod4.2%
*-commutative4.2%
*-commutative4.2%
add-sqr-sqrt2.2%
sqrt-unprod13.1%
*-commutative13.1%
sqrt-prod13.1%
*-commutative13.1%
associate-*r*13.1%
*-commutative13.1%
sqrt-prod13.1%
*-commutative13.1%
associate-*r*13.1%
swap-sqr13.1%
Applied egg-rr13.1%
associate-*r*13.1%
*-commutative13.1%
*-commutative13.1%
Simplified13.1%
if 4.7000000000000002e73 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
sqrt-unprod100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 81.2%
distribute-lft-out81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in t around inf 57.7%
associate-*l*54.4%
Simplified54.4%
pow154.4%
*-commutative54.4%
*-commutative54.4%
associate-*l*54.4%
sqrt-prod54.4%
*-commutative54.4%
Applied egg-rr54.4%
unpow154.4%
associate-*r*57.7%
*-commutative57.7%
*-commutative57.7%
Simplified57.7%
Final simplification64.7%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (* (exp (/ (* t_m t_m) 2.0)) (* (- (* x 0.5) y) (sqrt (* z 2.0)))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
return exp(((t_m * t_m) / 2.0)) * (((x * 0.5) - y) * sqrt((z * 2.0)));
}
t_m = abs(t)
real(8) function code(x, y, z, t_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = exp(((t_m * t_m) / 2.0d0)) * (((x * 0.5d0) - y) * sqrt((z * 2.0d0)))
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
return Math.exp(((t_m * t_m) / 2.0)) * (((x * 0.5) - y) * Math.sqrt((z * 2.0)));
}
t_m = math.fabs(t) def code(x, y, z, t_m): return math.exp(((t_m * t_m) / 2.0)) * (((x * 0.5) - y) * math.sqrt((z * 2.0)))
t_m = abs(t) function code(x, y, z, t_m) return Float64(exp(Float64(Float64(t_m * t_m) / 2.0)) * Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0)))) end
t_m = abs(t); function tmp = code(x, y, z, t_m) tmp = exp(((t_m * t_m) / 2.0)) * (((x * 0.5) - y) * sqrt((z * 2.0))); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_] := N[(N[Exp[N[(N[(t$95$m * t$95$m), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
e^{\frac{t\_m \cdot t\_m}{2}} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right)
\end{array}
Initial program 99.4%
Final simplification99.4%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (* (- (* x 0.5) y) (sqrt (* 2.0 (+ z (* z (pow t_m 2.0)))))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
return ((x * 0.5) - y) * sqrt((2.0 * (z + (z * pow(t_m, 2.0)))));
}
t_m = abs(t)
real(8) function code(x, y, z, t_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = ((x * 0.5d0) - y) * sqrt((2.0d0 * (z + (z * (t_m ** 2.0d0)))))
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
return ((x * 0.5) - y) * Math.sqrt((2.0 * (z + (z * Math.pow(t_m, 2.0)))));
}
t_m = math.fabs(t) def code(x, y, z, t_m): return ((x * 0.5) - y) * math.sqrt((2.0 * (z + (z * math.pow(t_m, 2.0)))))
t_m = abs(t) function code(x, y, z, t_m) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * Float64(z + Float64(z * (t_m ^ 2.0)))))) end
t_m = abs(t); function tmp = code(x, y, z, t_m) tmp = ((x * 0.5) - y) * sqrt((2.0 * (z + (z * (t_m ^ 2.0))))); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(z + N[(z * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z + z \cdot {t\_m}^{2}\right)}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 80.2%
distribute-lft-out80.2%
*-commutative80.2%
Simplified80.2%
Final simplification80.2%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (* (- (* x 0.5) y) (sqrt (* 2.0 (* z (fma t_m t_m 1.0))))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
return ((x * 0.5) - y) * sqrt((2.0 * (z * fma(t_m, t_m, 1.0))));
}
t_m = abs(t) function code(x, y, z, t_m) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * Float64(z * fma(t_m, t_m, 1.0))))) end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(z * N[(t$95$m * t$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z \cdot \mathsf{fma}\left(t\_m, t\_m, 1\right)\right)}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 80.2%
distribute-lft-out80.2%
distribute-rgt1-in80.2%
unpow280.2%
fma-define80.2%
Simplified80.2%
Final simplification80.2%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (let* ((t_1 (* (- (* x 0.5) y) (sqrt (* z 2.0))))) (if (<= t_m 0.0132) t_1 (* t_m t_1))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
double t_1 = ((x * 0.5) - y) * sqrt((z * 2.0));
double tmp;
if (t_m <= 0.0132) {
tmp = t_1;
} else {
tmp = t_m * t_1;
}
return tmp;
}
t_m = abs(t)
real(8) function code(x, y, z, t_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: t_1
real(8) :: tmp
t_1 = ((x * 0.5d0) - y) * sqrt((z * 2.0d0))
if (t_m <= 0.0132d0) then
tmp = t_1
else
tmp = t_m * t_1
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
double t_1 = ((x * 0.5) - y) * Math.sqrt((z * 2.0));
double tmp;
if (t_m <= 0.0132) {
tmp = t_1;
} else {
tmp = t_m * t_1;
}
return tmp;
}
t_m = math.fabs(t) def code(x, y, z, t_m): t_1 = ((x * 0.5) - y) * math.sqrt((z * 2.0)) tmp = 0 if t_m <= 0.0132: tmp = t_1 else: tmp = t_m * t_1 return tmp
t_m = abs(t) function code(x, y, z, t_m) t_1 = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) tmp = 0.0 if (t_m <= 0.0132) tmp = t_1; else tmp = Float64(t_m * t_1); end return tmp end
t_m = abs(t); function tmp_2 = code(x, y, z, t_m) t_1 = ((x * 0.5) - y) * sqrt((z * 2.0)); tmp = 0.0; if (t_m <= 0.0132) tmp = t_1; else tmp = t_m * t_1; end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
code[x_, y_, z_, t$95$m_] := Block[{t$95$1 = N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$m, 0.0132], t$95$1, N[(t$95$m * t$95$1), $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := \left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\\
\mathbf{if}\;t\_m \leq 0.0132:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_m \cdot t\_1\\
\end{array}
\end{array}
if t < 0.0132Initial program 99.2%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
sqrt-unprod99.8%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
Taylor expanded in t around 0 71.8%
if 0.0132 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
sqrt-unprod100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 68.4%
distribute-lft-out68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in t around inf 46.9%
associate-*l*44.5%
Simplified44.5%
pow144.5%
*-commutative44.5%
*-commutative44.5%
associate-*l*44.5%
sqrt-prod44.5%
*-commutative44.5%
Applied egg-rr44.5%
unpow144.5%
*-commutative44.5%
*-commutative44.5%
Simplified44.5%
Final simplification63.8%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (let* ((t_1 (- (* x 0.5) y)) (t_2 (sqrt (* z 2.0)))) (if (<= t_m 0.0132) (* t_1 t_2) (* t_2 (* t_1 t_m)))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
double t_1 = (x * 0.5) - y;
double t_2 = sqrt((z * 2.0));
double tmp;
if (t_m <= 0.0132) {
tmp = t_1 * t_2;
} else {
tmp = t_2 * (t_1 * t_m);
}
return tmp;
}
t_m = abs(t)
real(8) function code(x, y, z, t_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 0.5d0) - y
t_2 = sqrt((z * 2.0d0))
if (t_m <= 0.0132d0) then
tmp = t_1 * t_2
else
tmp = t_2 * (t_1 * t_m)
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
double t_1 = (x * 0.5) - y;
double t_2 = Math.sqrt((z * 2.0));
double tmp;
if (t_m <= 0.0132) {
tmp = t_1 * t_2;
} else {
tmp = t_2 * (t_1 * t_m);
}
return tmp;
}
t_m = math.fabs(t) def code(x, y, z, t_m): t_1 = (x * 0.5) - y t_2 = math.sqrt((z * 2.0)) tmp = 0 if t_m <= 0.0132: tmp = t_1 * t_2 else: tmp = t_2 * (t_1 * t_m) return tmp
t_m = abs(t) function code(x, y, z, t_m) t_1 = Float64(Float64(x * 0.5) - y) t_2 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (t_m <= 0.0132) tmp = Float64(t_1 * t_2); else tmp = Float64(t_2 * Float64(t_1 * t_m)); end return tmp end
t_m = abs(t); function tmp_2 = code(x, y, z, t_m) t_1 = (x * 0.5) - y; t_2 = sqrt((z * 2.0)); tmp = 0.0; if (t_m <= 0.0132) tmp = t_1 * t_2; else tmp = t_2 * (t_1 * t_m); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
code[x_, y_, z_, t$95$m_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$m, 0.0132], N[(t$95$1 * t$95$2), $MachinePrecision], N[(t$95$2 * N[(t$95$1 * t$95$m), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
t_2 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t\_m \leq 0.0132:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(t\_1 \cdot t\_m\right)\\
\end{array}
\end{array}
if t < 0.0132Initial program 99.2%
associate-*l*99.7%
exp-sqrt99.7%
exp-prod99.7%
Simplified99.7%
sqrt-unprod99.8%
pow-exp99.7%
pow299.7%
Applied egg-rr99.7%
Taylor expanded in t around 0 71.8%
if 0.0132 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
sqrt-unprod100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 68.4%
distribute-lft-out68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in t around inf 46.9%
associate-*l*44.5%
Simplified44.5%
pow144.5%
*-commutative44.5%
*-commutative44.5%
associate-*l*44.5%
sqrt-prod44.5%
*-commutative44.5%
Applied egg-rr44.5%
unpow144.5%
associate-*r*46.9%
*-commutative46.9%
*-commutative46.9%
Simplified46.9%
Final simplification64.5%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (* (- (* x 0.5) y) (sqrt (* z 2.0))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
return ((x * 0.5) - y) * sqrt((z * 2.0));
}
t_m = abs(t)
real(8) function code(x, y, z, t_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = ((x * 0.5d0) - y) * sqrt((z * 2.0d0))
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
return ((x * 0.5) - y) * Math.sqrt((z * 2.0));
}
t_m = math.fabs(t) def code(x, y, z, t_m): return ((x * 0.5) - y) * math.sqrt((z * 2.0))
t_m = abs(t) function code(x, y, z, t_m) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) end
t_m = abs(t); function tmp = code(x, y, z, t_m) tmp = ((x * 0.5) - y) * sqrt((z * 2.0)); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
sqrt-unprod99.8%
pow-exp99.8%
pow299.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 54.3%
Final simplification54.3%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (* x (sqrt (* 0.5 z))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
return x * sqrt((0.5 * z));
}
t_m = abs(t)
real(8) function code(x, y, z, t_m)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = x * sqrt((0.5d0 * z))
end function
t_m = Math.abs(t);
public static double code(double x, double y, double z, double t_m) {
return x * Math.sqrt((0.5 * z));
}
t_m = math.fabs(t) def code(x, y, z, t_m): return x * math.sqrt((0.5 * z))
t_m = abs(t) function code(x, y, z, t_m) return Float64(x * sqrt(Float64(0.5 * z))) end
t_m = abs(t); function tmp = code(x, y, z, t_m) tmp = x * sqrt((0.5 * z)); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_] := N[(x * N[Sqrt[N[(0.5 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
x \cdot \sqrt{0.5 \cdot z}
\end{array}
Initial program 99.4%
Taylor expanded in t around 0 54.1%
Taylor expanded in x around inf 25.1%
*-commutative25.1%
*-commutative25.1%
associate-*r*25.1%
*-commutative25.1%
Simplified25.1%
pow125.1%
associate-*r*25.2%
sqrt-prod25.2%
*-commutative25.2%
*-commutative25.2%
Applied egg-rr25.2%
unpow125.2%
*-commutative25.2%
*-commutative25.2%
*-commutative25.2%
Simplified25.2%
associate-*r*25.2%
sqrt-prod25.2%
associate-*r*25.2%
*-commutative25.2%
pow125.2%
*-commutative25.2%
add-sqr-sqrt25.1%
sqrt-unprod25.2%
swap-sqr25.1%
rem-square-sqrt25.2%
*-commutative25.2%
*-commutative25.2%
swap-sqr25.2%
add-sqr-sqrt25.2%
metadata-eval25.2%
Applied egg-rr25.2%
unpow125.2%
*-commutative25.2%
associate-*r*25.2%
metadata-eval25.2%
*-commutative25.2%
Simplified25.2%
Final simplification25.2%
(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 2024096
(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))))