
(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 15 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 (* (pow (exp t_m) (* 0.5 t_m)) (* (- (* x 0.5) y) (sqrt (* z 2.0)))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
return pow(exp(t_m), (0.5 * t_m)) * (((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) ** (0.5d0 * t_m)) * (((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.pow(Math.exp(t_m), (0.5 * t_m)) * (((x * 0.5) - y) * Math.sqrt((z * 2.0)));
}
t_m = math.fabs(t) def code(x, y, z, t_m): return math.pow(math.exp(t_m), (0.5 * t_m)) * (((x * 0.5) - y) * math.sqrt((z * 2.0)))
t_m = abs(t) function code(x, y, z, t_m) return Float64((exp(t_m) ^ Float64(0.5 * t_m)) * 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) ^ (0.5 * t_m)) * (((x * 0.5) - y) * sqrt((z * 2.0))); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_] := N[(N[Power[N[Exp[t$95$m], $MachinePrecision], N[(0.5 * t$95$m), $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|
\\
{\left(e^{t\_m}\right)}^{\left(0.5 \cdot t\_m\right)} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right)
\end{array}
Initial program 99.8%
exp-sqrt99.8%
pow-exp99.9%
pow1/299.9%
pow-pow99.9%
Applied egg-rr99.9%
Final simplification99.9%
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.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
expm1-log1p-u98.9%
expm1-udef74.9%
sqrt-unprod74.9%
associate-*l*74.9%
pow-exp74.9%
pow274.9%
Applied egg-rr74.9%
expm1-def98.9%
expm1-log1p99.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
unpow299.8%
pow-exp99.9%
Applied egg-rr99.9%
Final simplification99.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 6.5e-31)
(* t_1 t_2)
(if (<= t_m 1.05e+74)
(* t_1 (cbrt (pow (* z 2.0) 1.5)))
(* t_1 (* t_2 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 <= 6.5e-31) {
tmp = t_1 * t_2;
} else if (t_m <= 1.05e+74) {
tmp = t_1 * cbrt(pow((z * 2.0), 1.5));
} else {
tmp = t_1 * (t_2 * t_m);
}
return tmp;
}
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 <= 6.5e-31) {
tmp = t_1 * t_2;
} else if (t_m <= 1.05e+74) {
tmp = t_1 * Math.cbrt(Math.pow((z * 2.0), 1.5));
} else {
tmp = t_1 * (t_2 * 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 <= 6.5e-31) tmp = Float64(t_1 * t_2); elseif (t_m <= 1.05e+74) tmp = Float64(t_1 * cbrt((Float64(z * 2.0) ^ 1.5))); else tmp = Float64(t_1 * Float64(t_2 * t_m)); end return 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, 6.5e-31], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[t$95$m, 1.05e+74], N[(t$95$1 * N[Power[N[Power[N[(z * 2.0), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$2 * 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 6.5 \cdot 10^{-31}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+74}:\\
\;\;\;\;t\_1 \cdot \sqrt[3]{{\left(z \cdot 2\right)}^{1.5}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot t\_m\right)\\
\end{array}
\end{array}
if t < 6.49999999999999967e-31Initial program 99.8%
*-commutative99.8%
associate-*l*99.3%
exp-sqrt99.3%
Simplified99.3%
Taylor expanded in t around 0 69.5%
if 6.49999999999999967e-31 < t < 1.0499999999999999e74Initial program 99.8%
*-commutative99.8%
associate-*l*99.8%
exp-sqrt99.7%
Simplified99.7%
Taylor expanded in t around 0 25.1%
add-cbrt-cube42.8%
add-sqr-sqrt42.8%
pow142.8%
pow1/242.8%
pow-prod-up42.8%
metadata-eval42.8%
Applied egg-rr42.8%
if 1.0499999999999999e74 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 85.5%
Taylor expanded in t around inf 69.2%
associate-*l*55.2%
*-commutative55.2%
Simplified55.2%
Taylor expanded in t around 0 69.2%
*-commutative69.2%
*-commutative69.2%
sub-neg69.2%
*-commutative69.2%
sub-neg69.2%
associate-*r*55.2%
Simplified56.9%
Final simplification64.9%
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t_m 1.0)
(* t_1 (sqrt (* z 2.0)))
(* t_1 (sqrt (* (* z 2.0) (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 <= 1.0) {
tmp = t_1 * sqrt((z * 2.0));
} else {
tmp = t_1 * sqrt(((z * 2.0) * 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 <= 1.0d0) then
tmp = t_1 * sqrt((z * 2.0d0))
else
tmp = t_1 * sqrt(((z * 2.0d0) * (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 <= 1.0) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else {
tmp = t_1 * Math.sqrt(((z * 2.0) * 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 <= 1.0: tmp = t_1 * math.sqrt((z * 2.0)) else: tmp = t_1 * math.sqrt(((z * 2.0) * 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 <= 1.0) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); else tmp = Float64(t_1 * sqrt(Float64(Float64(z * 2.0) * (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 <= 1.0) tmp = t_1 * sqrt((z * 2.0)); else tmp = t_1 * sqrt(((z * 2.0) * (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, 1.0], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[t$95$m, 2.0], $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 1:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{\left(z \cdot 2\right) \cdot {t\_m}^{2}}\\
\end{array}
\end{array}
if t < 1Initial program 99.8%
*-commutative99.8%
associate-*l*99.3%
exp-sqrt99.3%
Simplified99.3%
Taylor expanded in t around 0 69.8%
if 1 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 76.2%
Taylor expanded in t around inf 76.2%
*-commutative76.2%
associate-*l*76.2%
*-commutative76.2%
Simplified76.2%
Final simplification71.6%
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t_m 1.4e+24)
(* t_1 (* (sqrt (* z 2.0)) (hypot 1.0 t_m)))
(* t_1 (sqrt (* (* z 2.0) (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 <= 1.4e+24) {
tmp = t_1 * (sqrt((z * 2.0)) * hypot(1.0, t_m));
} else {
tmp = t_1 * sqrt(((z * 2.0) * pow(t_m, 2.0)));
}
return tmp;
}
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 <= 1.4e+24) {
tmp = t_1 * (Math.sqrt((z * 2.0)) * Math.hypot(1.0, t_m));
} else {
tmp = t_1 * Math.sqrt(((z * 2.0) * 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 <= 1.4e+24: tmp = t_1 * (math.sqrt((z * 2.0)) * math.hypot(1.0, t_m)) else: tmp = t_1 * math.sqrt(((z * 2.0) * 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 <= 1.4e+24) tmp = Float64(t_1 * Float64(sqrt(Float64(z * 2.0)) * hypot(1.0, t_m))); else tmp = Float64(t_1 * sqrt(Float64(Float64(z * 2.0) * (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 <= 1.4e+24) tmp = t_1 * (sqrt((z * 2.0)) * hypot(1.0, t_m)); else tmp = t_1 * sqrt(((z * 2.0) * (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, 1.4e+24], N[(t$95$1 * N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[1.0 ^ 2 + t$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Power[t$95$m, 2.0], $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 1.4 \cdot 10^{+24}:\\
\;\;\;\;t\_1 \cdot \left(\sqrt{z \cdot 2} \cdot \mathsf{hypot}\left(1, t\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{\left(z \cdot 2\right) \cdot {t\_m}^{2}}\\
\end{array}
\end{array}
if t < 1.4000000000000001e24Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
expm1-log1p-u98.5%
expm1-udef66.2%
sqrt-unprod66.2%
associate-*l*66.2%
pow-exp66.2%
pow266.2%
Applied egg-rr66.2%
expm1-def98.5%
expm1-log1p99.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 87.3%
*-commutative87.3%
sqrt-prod86.8%
unpow286.8%
hypot-1-def82.9%
Applied egg-rr82.9%
if 1.4000000000000001e24 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 81.6%
Taylor expanded in t around inf 81.6%
*-commutative81.6%
associate-*l*81.6%
*-commutative81.6%
Simplified81.6%
Final simplification82.5%
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= t_m 1.0)
(* t_1 (sqrt (* z 2.0)))
(* (* t_m (* t_1 (sqrt 2.0))) (sqrt z)))))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 <= 1.0) {
tmp = t_1 * sqrt((z * 2.0));
} else {
tmp = (t_m * (t_1 * sqrt(2.0))) * sqrt(z);
}
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 <= 1.0d0) then
tmp = t_1 * sqrt((z * 2.0d0))
else
tmp = (t_m * (t_1 * sqrt(2.0d0))) * sqrt(z)
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 <= 1.0) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else {
tmp = (t_m * (t_1 * Math.sqrt(2.0))) * Math.sqrt(z);
}
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 <= 1.0: tmp = t_1 * math.sqrt((z * 2.0)) else: tmp = (t_m * (t_1 * math.sqrt(2.0))) * math.sqrt(z) 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 <= 1.0) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); else tmp = Float64(Float64(t_m * Float64(t_1 * sqrt(2.0))) * sqrt(z)); 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 <= 1.0) tmp = t_1 * sqrt((z * 2.0)); else tmp = (t_m * (t_1 * sqrt(2.0))) * sqrt(z); 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, 1.0], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(t$95$m * N[(t$95$1 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[z], $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 1:\\
\;\;\;\;t\_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_m \cdot \left(t\_1 \cdot \sqrt{2}\right)\right) \cdot \sqrt{z}\\
\end{array}
\end{array}
if t < 1Initial program 99.8%
*-commutative99.8%
associate-*l*99.3%
exp-sqrt99.3%
Simplified99.3%
Taylor expanded in t around 0 69.8%
if 1 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 76.2%
Taylor expanded in t around inf 62.3%
Final simplification67.8%
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.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) (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(((z * 2.0) * 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(Float64(z * 2.0) * 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[(N[(z * 2.0), $MachinePrecision] * N[(t$95$m * t$95$m + 1.0), $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 \mathsf{fma}\left(t\_m, t\_m, 1\right)}
\end{array}
Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.8%
Simplified99.8%
expm1-log1p-u98.9%
expm1-udef74.9%
sqrt-unprod74.9%
associate-*l*74.9%
pow-exp74.9%
pow274.9%
Applied egg-rr74.9%
expm1-def98.9%
expm1-log1p99.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 85.8%
+-commutative85.8%
unpow285.8%
fma-def85.8%
Simplified85.8%
Final simplification85.8%
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (<= y -1.7e+107)
(* (* y t_1) (- t_m))
(if (or (<= y -2.4e+24) (not (<= y 8e+83)))
(* y (- t_1))
(* 0.5 (* x t_1))))))t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
double t_1 = sqrt((z * 2.0));
double tmp;
if (y <= -1.7e+107) {
tmp = (y * t_1) * -t_m;
} else if ((y <= -2.4e+24) || !(y <= 8e+83)) {
tmp = y * -t_1;
} else {
tmp = 0.5 * (x * 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 = sqrt((z * 2.0d0))
if (y <= (-1.7d+107)) then
tmp = (y * t_1) * -t_m
else if ((y <= (-2.4d+24)) .or. (.not. (y <= 8d+83))) then
tmp = y * -t_1
else
tmp = 0.5d0 * (x * 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 = Math.sqrt((z * 2.0));
double tmp;
if (y <= -1.7e+107) {
tmp = (y * t_1) * -t_m;
} else if ((y <= -2.4e+24) || !(y <= 8e+83)) {
tmp = y * -t_1;
} else {
tmp = 0.5 * (x * t_1);
}
return tmp;
}
t_m = math.fabs(t) def code(x, y, z, t_m): t_1 = math.sqrt((z * 2.0)) tmp = 0 if y <= -1.7e+107: tmp = (y * t_1) * -t_m elif (y <= -2.4e+24) or not (y <= 8e+83): tmp = y * -t_1 else: tmp = 0.5 * (x * t_1) return tmp
t_m = abs(t) function code(x, y, z, t_m) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (y <= -1.7e+107) tmp = Float64(Float64(y * t_1) * Float64(-t_m)); elseif ((y <= -2.4e+24) || !(y <= 8e+83)) tmp = Float64(y * Float64(-t_1)); else tmp = Float64(0.5 * Float64(x * t_1)); end return tmp end
t_m = abs(t); function tmp_2 = code(x, y, z, t_m) t_1 = sqrt((z * 2.0)); tmp = 0.0; if (y <= -1.7e+107) tmp = (y * t_1) * -t_m; elseif ((y <= -2.4e+24) || ~((y <= 8e+83))) tmp = y * -t_1; else tmp = 0.5 * (x * 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[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -1.7e+107], N[(N[(y * t$95$1), $MachinePrecision] * (-t$95$m)), $MachinePrecision], If[Or[LessEqual[y, -2.4e+24], N[Not[LessEqual[y, 8e+83]], $MachinePrecision]], N[(y * (-t$95$1)), $MachinePrecision], N[(0.5 * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+107}:\\
\;\;\;\;\left(y \cdot t\_1\right) \cdot \left(-t\_m\right)\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{+24} \lor \neg \left(y \leq 8 \cdot 10^{+83}\right):\\
\;\;\;\;y \cdot \left(-t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\
\end{array}
\end{array}
if y < -1.6999999999999998e107Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef77.7%
sqrt-unprod77.7%
associate-*l*77.7%
pow-exp77.7%
pow277.7%
Applied egg-rr77.7%
expm1-def100.0%
expm1-log1p100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 89.6%
Taylor expanded in t around inf 39.7%
associate-*l*31.8%
*-commutative31.8%
Simplified31.8%
Taylor expanded in x around 0 41.9%
mul-1-neg41.9%
associate-*l*34.0%
distribute-rgt-neg-in34.0%
associate-*l*34.0%
*-commutative34.0%
distribute-lft-neg-in34.0%
unpow1/234.0%
exp-to-pow34.0%
unpow1/234.0%
exp-to-pow34.0%
exp-sum34.0%
distribute-rgt-in34.0%
log-prod34.0%
log-pow34.0%
unpow1/234.0%
rem-exp-log34.0%
distribute-lft-neg-out34.0%
distribute-rgt-neg-in34.0%
Simplified34.0%
if -1.6999999999999998e107 < y < -2.4000000000000001e24 or 8.00000000000000025e83 < y Initial program 99.8%
*-commutative99.8%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 61.8%
Taylor expanded in x around 0 52.7%
associate-*r*52.7%
mul-1-neg52.7%
distribute-lft-neg-out52.7%
*-commutative52.7%
associate-*l*52.7%
Simplified52.7%
*-commutative52.7%
distribute-lft-neg-out52.7%
distribute-lft-neg-out52.7%
add-sqr-sqrt43.9%
sqrt-unprod52.4%
sqr-neg52.4%
sqrt-unprod0.2%
add-sqr-sqrt1.0%
associate-*l*1.0%
add-sqr-sqrt0.2%
sqrt-unprod52.3%
sqr-neg52.3%
sqrt-unprod43.7%
add-sqr-sqrt52.7%
sqrt-prod53.0%
*-commutative53.0%
Applied egg-rr53.0%
*-commutative53.0%
distribute-rgt-neg-in53.0%
Simplified53.0%
if -2.4000000000000001e24 < y < 8.00000000000000025e83Initial program 99.8%
*-commutative99.8%
associate-*l*99.2%
exp-sqrt99.2%
Simplified99.2%
Taylor expanded in t around 0 54.3%
associate-*r*54.3%
*-commutative54.3%
*-commutative54.3%
fma-neg54.3%
associate-*l*54.3%
fma-neg54.3%
*-commutative54.3%
Simplified54.3%
Taylor expanded in x around inf 41.7%
associate-*l*41.6%
Simplified41.6%
Taylor expanded in x around 0 41.7%
associate-*l*41.6%
*-commutative41.6%
unpow1/241.6%
exp-to-pow39.6%
unpow1/239.6%
exp-to-pow39.6%
exp-sum39.5%
distribute-rgt-in39.5%
log-prod39.7%
log-pow39.7%
unpow1/239.7%
rem-exp-log41.8%
Simplified41.8%
Final simplification42.9%
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (or (<= x -1.05e+63) (not (<= x 4.3e+110)))
(* 0.5 (* x t_1))
(* y (- t_1)))))t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
double t_1 = sqrt((z * 2.0));
double tmp;
if ((x <= -1.05e+63) || !(x <= 4.3e+110)) {
tmp = 0.5 * (x * t_1);
} else {
tmp = y * -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 = sqrt((z * 2.0d0))
if ((x <= (-1.05d+63)) .or. (.not. (x <= 4.3d+110))) then
tmp = 0.5d0 * (x * t_1)
else
tmp = y * -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 = Math.sqrt((z * 2.0));
double tmp;
if ((x <= -1.05e+63) || !(x <= 4.3e+110)) {
tmp = 0.5 * (x * t_1);
} else {
tmp = y * -t_1;
}
return tmp;
}
t_m = math.fabs(t) def code(x, y, z, t_m): t_1 = math.sqrt((z * 2.0)) tmp = 0 if (x <= -1.05e+63) or not (x <= 4.3e+110): tmp = 0.5 * (x * t_1) else: tmp = y * -t_1 return tmp
t_m = abs(t) function code(x, y, z, t_m) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if ((x <= -1.05e+63) || !(x <= 4.3e+110)) tmp = Float64(0.5 * Float64(x * t_1)); else tmp = Float64(y * Float64(-t_1)); end return tmp end
t_m = abs(t); function tmp_2 = code(x, y, z, t_m) t_1 = sqrt((z * 2.0)); tmp = 0.0; if ((x <= -1.05e+63) || ~((x <= 4.3e+110))) tmp = 0.5 * (x * t_1); else tmp = y * -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[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x, -1.05e+63], N[Not[LessEqual[x, 4.3e+110]], $MachinePrecision]], N[(0.5 * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], N[(y * (-t$95$1)), $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+63} \lor \neg \left(x \leq 4.3 \cdot 10^{+110}\right):\\
\;\;\;\;0.5 \cdot \left(x \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-t\_1\right)\\
\end{array}
\end{array}
if x < -1.0500000000000001e63 or 4.30000000000000007e110 < x Initial program 99.8%
*-commutative99.8%
associate-*l*98.9%
exp-sqrt98.9%
Simplified98.9%
Taylor expanded in t around 0 54.4%
associate-*r*54.3%
*-commutative54.3%
*-commutative54.3%
fma-neg54.3%
associate-*l*54.4%
fma-neg54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in x around inf 51.1%
associate-*l*51.0%
Simplified51.0%
Taylor expanded in x around 0 51.1%
associate-*l*51.0%
*-commutative51.0%
unpow1/251.0%
exp-to-pow48.8%
unpow1/248.8%
exp-to-pow48.8%
exp-sum48.8%
distribute-rgt-in48.8%
log-prod49.0%
log-pow49.0%
unpow1/249.0%
rem-exp-log51.2%
Simplified51.2%
if -1.0500000000000001e63 < x < 4.30000000000000007e110Initial program 99.8%
*-commutative99.8%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 54.2%
Taylor expanded in x around 0 40.8%
associate-*r*40.8%
mul-1-neg40.8%
distribute-lft-neg-out40.8%
*-commutative40.8%
associate-*l*40.8%
Simplified40.8%
*-commutative40.8%
distribute-lft-neg-out40.8%
distribute-lft-neg-out40.8%
add-sqr-sqrt22.5%
sqrt-unprod24.6%
sqr-neg24.6%
sqrt-unprod1.5%
add-sqr-sqrt2.7%
associate-*l*2.7%
add-sqr-sqrt1.5%
sqrt-unprod24.6%
sqr-neg24.6%
sqrt-unprod22.5%
add-sqr-sqrt40.8%
sqrt-prod40.9%
*-commutative40.9%
Applied egg-rr40.9%
*-commutative40.9%
distribute-rgt-neg-in40.9%
Simplified40.9%
Final simplification44.8%
t_m = (fabs.f64 t)
(FPCore (x y z t_m)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))) (t_2 (* x t_1)))
(if (<= x -4e+63)
(* 0.5 (* t_m t_2))
(if (<= x 1.44e+110) (* y (- t_1)) (* 0.5 t_2)))))t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
double t_1 = sqrt((z * 2.0));
double t_2 = x * t_1;
double tmp;
if (x <= -4e+63) {
tmp = 0.5 * (t_m * t_2);
} else if (x <= 1.44e+110) {
tmp = y * -t_1;
} else {
tmp = 0.5 * t_2;
}
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 = sqrt((z * 2.0d0))
t_2 = x * t_1
if (x <= (-4d+63)) then
tmp = 0.5d0 * (t_m * t_2)
else if (x <= 1.44d+110) then
tmp = y * -t_1
else
tmp = 0.5d0 * t_2
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 = Math.sqrt((z * 2.0));
double t_2 = x * t_1;
double tmp;
if (x <= -4e+63) {
tmp = 0.5 * (t_m * t_2);
} else if (x <= 1.44e+110) {
tmp = y * -t_1;
} else {
tmp = 0.5 * t_2;
}
return tmp;
}
t_m = math.fabs(t) def code(x, y, z, t_m): t_1 = math.sqrt((z * 2.0)) t_2 = x * t_1 tmp = 0 if x <= -4e+63: tmp = 0.5 * (t_m * t_2) elif x <= 1.44e+110: tmp = y * -t_1 else: tmp = 0.5 * t_2 return tmp
t_m = abs(t) function code(x, y, z, t_m) t_1 = sqrt(Float64(z * 2.0)) t_2 = Float64(x * t_1) tmp = 0.0 if (x <= -4e+63) tmp = Float64(0.5 * Float64(t_m * t_2)); elseif (x <= 1.44e+110) tmp = Float64(y * Float64(-t_1)); else tmp = Float64(0.5 * t_2); end return tmp end
t_m = abs(t); function tmp_2 = code(x, y, z, t_m) t_1 = sqrt((z * 2.0)); t_2 = x * t_1; tmp = 0.0; if (x <= -4e+63) tmp = 0.5 * (t_m * t_2); elseif (x <= 1.44e+110) tmp = y * -t_1; else tmp = 0.5 * t_2; end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
code[x_, y_, z_, t$95$m_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(x * t$95$1), $MachinePrecision]}, If[LessEqual[x, -4e+63], N[(0.5 * N[(t$95$m * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.44e+110], N[(y * (-t$95$1)), $MachinePrecision], N[(0.5 * t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
t_2 := x \cdot t\_1\\
\mathbf{if}\;x \leq -4 \cdot 10^{+63}:\\
\;\;\;\;0.5 \cdot \left(t\_m \cdot t\_2\right)\\
\mathbf{elif}\;x \leq 1.44 \cdot 10^{+110}:\\
\;\;\;\;y \cdot \left(-t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot t\_2\\
\end{array}
\end{array}
if x < -4.00000000000000023e63Initial program 99.8%
associate-*l*99.8%
exp-sqrt99.8%
exp-prod99.9%
Simplified99.9%
expm1-log1p-u99.3%
expm1-udef84.9%
sqrt-unprod84.9%
associate-*l*84.9%
pow-exp84.8%
pow284.8%
Applied egg-rr84.8%
expm1-def99.2%
expm1-log1p99.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 88.2%
Taylor expanded in t around inf 36.6%
associate-*l*34.9%
*-commutative34.9%
Simplified34.9%
Taylor expanded in x around inf 28.3%
associate-*l*32.3%
associate-*l*32.3%
*-commutative32.3%
unpow1/232.3%
exp-to-pow32.3%
unpow1/232.3%
exp-to-pow32.3%
exp-sum32.3%
distribute-rgt-in32.3%
log-prod32.3%
log-pow32.3%
unpow1/232.3%
rem-exp-log32.3%
Simplified32.3%
if -4.00000000000000023e63 < x < 1.44e110Initial program 99.8%
*-commutative99.8%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 54.2%
Taylor expanded in x around 0 40.8%
associate-*r*40.8%
mul-1-neg40.8%
distribute-lft-neg-out40.8%
*-commutative40.8%
associate-*l*40.8%
Simplified40.8%
*-commutative40.8%
distribute-lft-neg-out40.8%
distribute-lft-neg-out40.8%
add-sqr-sqrt22.5%
sqrt-unprod24.6%
sqr-neg24.6%
sqrt-unprod1.5%
add-sqr-sqrt2.7%
associate-*l*2.7%
add-sqr-sqrt1.5%
sqrt-unprod24.6%
sqr-neg24.6%
sqrt-unprod22.5%
add-sqr-sqrt40.8%
sqrt-prod40.9%
*-commutative40.9%
Applied egg-rr40.9%
*-commutative40.9%
distribute-rgt-neg-in40.9%
Simplified40.9%
if 1.44e110 < x Initial program 99.8%
*-commutative99.8%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
Taylor expanded in t around 0 60.1%
associate-*r*60.1%
*-commutative60.1%
*-commutative60.1%
fma-neg60.1%
associate-*l*60.2%
fma-neg60.2%
*-commutative60.2%
Simplified60.2%
Taylor expanded in x around inf 58.0%
associate-*l*58.0%
Simplified58.0%
Taylor expanded in x around 0 58.0%
associate-*l*58.0%
*-commutative58.0%
unpow1/258.0%
exp-to-pow55.2%
unpow1/255.2%
exp-to-pow55.2%
exp-sum55.3%
distribute-rgt-in55.3%
log-prod55.5%
log-pow55.5%
unpow1/255.5%
rem-exp-log58.1%
Simplified58.1%
Final simplification42.6%
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 1.0) (* t_1 t_2) (* t_1 (* t_2 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 <= 1.0) {
tmp = t_1 * t_2;
} else {
tmp = t_1 * (t_2 * 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 <= 1.0d0) then
tmp = t_1 * t_2
else
tmp = t_1 * (t_2 * 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 <= 1.0) {
tmp = t_1 * t_2;
} else {
tmp = t_1 * (t_2 * 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 <= 1.0: tmp = t_1 * t_2 else: tmp = t_1 * (t_2 * 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 <= 1.0) tmp = Float64(t_1 * t_2); else tmp = Float64(t_1 * Float64(t_2 * 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 <= 1.0) tmp = t_1 * t_2; else tmp = t_1 * (t_2 * 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, 1.0], N[(t$95$1 * t$95$2), $MachinePrecision], N[(t$95$1 * N[(t$95$2 * 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 1:\\
\;\;\;\;t\_1 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 \cdot t\_m\right)\\
\end{array}
\end{array}
if t < 1Initial program 99.8%
*-commutative99.8%
associate-*l*99.3%
exp-sqrt99.3%
Simplified99.3%
Taylor expanded in t around 0 69.8%
if 1 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 76.2%
Taylor expanded in t around inf 62.3%
associate-*l*47.0%
*-commutative47.0%
Simplified47.0%
Taylor expanded in t around 0 62.3%
*-commutative62.3%
*-commutative62.3%
sub-neg62.3%
*-commutative62.3%
sub-neg62.3%
associate-*r*47.0%
Simplified48.4%
Final simplification63.9%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (let* ((t_1 (sqrt (* z 2.0)))) (if (<= t_m 1.15e+89) (* (- (* x 0.5) y) t_1) (* 0.5 (* t_m (* x t_1))))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
double t_1 = sqrt((z * 2.0));
double tmp;
if (t_m <= 1.15e+89) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = 0.5 * (t_m * (x * 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 = sqrt((z * 2.0d0))
if (t_m <= 1.15d+89) then
tmp = ((x * 0.5d0) - y) * t_1
else
tmp = 0.5d0 * (t_m * (x * 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 = Math.sqrt((z * 2.0));
double tmp;
if (t_m <= 1.15e+89) {
tmp = ((x * 0.5) - y) * t_1;
} else {
tmp = 0.5 * (t_m * (x * t_1));
}
return tmp;
}
t_m = math.fabs(t) def code(x, y, z, t_m): t_1 = math.sqrt((z * 2.0)) tmp = 0 if t_m <= 1.15e+89: tmp = ((x * 0.5) - y) * t_1 else: tmp = 0.5 * (t_m * (x * t_1)) return tmp
t_m = abs(t) function code(x, y, z, t_m) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (t_m <= 1.15e+89) tmp = Float64(Float64(Float64(x * 0.5) - y) * t_1); else tmp = Float64(0.5 * Float64(t_m * Float64(x * t_1))); end return tmp end
t_m = abs(t); function tmp_2 = code(x, y, z, t_m) t_1 = sqrt((z * 2.0)); tmp = 0.0; if (t_m <= 1.15e+89) tmp = ((x * 0.5) - y) * t_1; else tmp = 0.5 * (t_m * (x * 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[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$m, 1.15e+89], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * t$95$1), $MachinePrecision], N[(0.5 * N[(t$95$m * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t\_m \leq 1.15 \cdot 10^{+89}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(t\_m \cdot \left(x \cdot t\_1\right)\right)\\
\end{array}
\end{array}
if t < 1.1499999999999999e89Initial program 99.8%
*-commutative99.8%
associate-*l*99.4%
exp-sqrt99.4%
Simplified99.4%
Taylor expanded in t around 0 65.8%
if 1.1499999999999999e89 < t Initial program 100.0%
associate-*l*100.0%
exp-sqrt100.0%
exp-prod100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
sqrt-unprod100.0%
associate-*l*100.0%
pow-exp100.0%
pow2100.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 87.6%
Taylor expanded in t around inf 68.1%
associate-*l*54.6%
*-commutative54.6%
Simplified54.6%
Taylor expanded in x around inf 38.5%
associate-*l*33.3%
associate-*l*33.3%
*-commutative33.3%
unpow1/233.3%
exp-to-pow33.3%
unpow1/233.3%
exp-to-pow33.3%
exp-sum33.3%
distribute-rgt-in33.3%
log-prod33.3%
log-pow33.3%
unpow1/233.3%
rem-exp-log33.3%
Simplified33.3%
Final simplification58.9%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (* y (- (sqrt (* z 2.0)))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
return 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 = 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 y * -Math.sqrt((z * 2.0));
}
t_m = math.fabs(t) def code(x, y, z, t_m): return y * -math.sqrt((z * 2.0))
t_m = abs(t) function code(x, y, z, t_m) return Float64(y * Float64(-sqrt(Float64(z * 2.0)))) end
t_m = abs(t); function tmp = code(x, y, z, t_m) tmp = y * -sqrt((z * 2.0)); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_] := N[(y * (-N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
y \cdot \left(-\sqrt{z \cdot 2}\right)
\end{array}
Initial program 99.8%
*-commutative99.8%
associate-*l*99.5%
exp-sqrt99.5%
Simplified99.5%
Taylor expanded in t around 0 54.3%
Taylor expanded in x around 0 27.8%
associate-*r*27.8%
mul-1-neg27.8%
distribute-lft-neg-out27.8%
*-commutative27.8%
associate-*l*27.8%
Simplified27.8%
*-commutative27.8%
distribute-lft-neg-out27.8%
distribute-lft-neg-out27.8%
add-sqr-sqrt14.4%
sqrt-unprod17.1%
sqr-neg17.1%
sqrt-unprod1.3%
add-sqr-sqrt2.4%
associate-*l*2.4%
add-sqr-sqrt1.3%
sqrt-unprod17.1%
sqr-neg17.1%
sqrt-unprod14.4%
add-sqr-sqrt27.8%
sqrt-prod27.9%
*-commutative27.9%
Applied egg-rr27.9%
*-commutative27.9%
distribute-rgt-neg-in27.9%
Simplified27.9%
Final simplification27.9%
t_m = (fabs.f64 t) (FPCore (x y z t_m) :precision binary64 (* y (sqrt (* z 2.0))))
t_m = fabs(t);
double code(double x, double y, double z, double t_m) {
return 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 = 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 y * Math.sqrt((z * 2.0));
}
t_m = math.fabs(t) def code(x, y, z, t_m): return y * math.sqrt((z * 2.0))
t_m = abs(t) function code(x, y, z, t_m) return Float64(y * sqrt(Float64(z * 2.0))) end
t_m = abs(t); function tmp = code(x, y, z, t_m) tmp = y * sqrt((z * 2.0)); end
t_m = N[Abs[t], $MachinePrecision] code[x_, y_, z_, t$95$m_] := N[(y * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
y \cdot \sqrt{z \cdot 2}
\end{array}
Initial program 99.8%
*-commutative99.8%
associate-*l*99.5%
exp-sqrt99.5%
Simplified99.5%
Taylor expanded in t around 0 54.3%
Taylor expanded in x around 0 27.8%
associate-*r*27.8%
mul-1-neg27.8%
distribute-lft-neg-out27.8%
*-commutative27.8%
associate-*l*27.8%
Simplified27.8%
expm1-log1p-u16.6%
expm1-udef11.0%
*-commutative11.0%
associate-*l*11.0%
add-sqr-sqrt9.5%
sqrt-unprod15.1%
sqr-neg15.1%
sqrt-unprod1.2%
add-sqr-sqrt2.3%
sqrt-prod2.3%
*-commutative2.3%
Applied egg-rr2.3%
expm1-def2.2%
expm1-log1p2.8%
Simplified2.8%
Final simplification2.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 2024031
(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))))