
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
(FPCore (x y z t) :precision binary64 (* (sqrt (* (exp (* t t)) (* 2.0 z))) (- (* x 0.5) y)))
double code(double x, double y, double z, double t) {
return sqrt((exp((t * t)) * (2.0 * z))) * ((x * 0.5) - y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((exp((t * t)) * (2.0d0 * z))) * ((x * 0.5d0) - y)
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((Math.exp((t * t)) * (2.0 * z))) * ((x * 0.5) - y);
}
def code(x, y, z, t): return math.sqrt((math.exp((t * t)) * (2.0 * z))) * ((x * 0.5) - y)
function code(x, y, z, t) return Float64(sqrt(Float64(exp(Float64(t * t)) * Float64(2.0 * z))) * Float64(Float64(x * 0.5) - y)) end
function tmp = code(x, y, z, t) tmp = sqrt((exp((t * t)) * (2.0 * z))) * ((x * 0.5) - y); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{e^{t \cdot t} \cdot \left(2 \cdot z\right)} \cdot \left(x \cdot 0.5 - y\right)
\end{array}
Initial program 99.4%
sqr-neg99.4%
associate-/l*99.4%
distribute-frac-neg99.4%
exp-neg99.5%
associate-*r/99.5%
*-rgt-identity99.5%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
exp-sqrt99.8%
Simplified99.8%
expm1-log1p-u98.3%
expm1-udef80.4%
pow-exp80.4%
sqrt-unprod80.4%
associate-*l*80.4%
Applied egg-rr80.4%
expm1-def98.3%
expm1-log1p99.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
pow-exp99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* t (* t (- y (* x 0.5)))))
(t_2 (- (* x 0.5) y))
(t_3 (* 0.5 (* t t)))
(t_4 (sqrt (* 2.0 z))))
(if (<= (* t t) 4e+32)
(* t_4 (- (* 0.5 (+ x (* t (* t t_2)))) y))
(if (<= (* t t) 2e+107)
(* t_4 (- (* 0.5 (/ (- (* x x) (* t_1 t_1)) (+ x t_1))) y))
(if (<= (* t t) 2e+121)
(* t_4 (- (* 0.5 (+ x (* t (* x (* 0.5 t))))) y))
(if (<= (* t t) 5e+279)
(* t_4 (* y (/ (+ (* t_3 t_3) -1.0) (- 1.0 t_3))))
(* t_2 (sqrt (* (* 2.0 z) (+ (* t t) 1.0))))))))))
double code(double x, double y, double z, double t) {
double t_1 = t * (t * (y - (x * 0.5)));
double t_2 = (x * 0.5) - y;
double t_3 = 0.5 * (t * t);
double t_4 = sqrt((2.0 * z));
double tmp;
if ((t * t) <= 4e+32) {
tmp = t_4 * ((0.5 * (x + (t * (t * t_2)))) - y);
} else if ((t * t) <= 2e+107) {
tmp = t_4 * ((0.5 * (((x * x) - (t_1 * t_1)) / (x + t_1))) - y);
} else if ((t * t) <= 2e+121) {
tmp = t_4 * ((0.5 * (x + (t * (x * (0.5 * t))))) - y);
} else if ((t * t) <= 5e+279) {
tmp = t_4 * (y * (((t_3 * t_3) + -1.0) / (1.0 - t_3)));
} else {
tmp = t_2 * sqrt(((2.0 * z) * ((t * t) + 1.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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = t * (t * (y - (x * 0.5d0)))
t_2 = (x * 0.5d0) - y
t_3 = 0.5d0 * (t * t)
t_4 = sqrt((2.0d0 * z))
if ((t * t) <= 4d+32) then
tmp = t_4 * ((0.5d0 * (x + (t * (t * t_2)))) - y)
else if ((t * t) <= 2d+107) then
tmp = t_4 * ((0.5d0 * (((x * x) - (t_1 * t_1)) / (x + t_1))) - y)
else if ((t * t) <= 2d+121) then
tmp = t_4 * ((0.5d0 * (x + (t * (x * (0.5d0 * t))))) - y)
else if ((t * t) <= 5d+279) then
tmp = t_4 * (y * (((t_3 * t_3) + (-1.0d0)) / (1.0d0 - t_3)))
else
tmp = t_2 * sqrt(((2.0d0 * z) * ((t * t) + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * (t * (y - (x * 0.5)));
double t_2 = (x * 0.5) - y;
double t_3 = 0.5 * (t * t);
double t_4 = Math.sqrt((2.0 * z));
double tmp;
if ((t * t) <= 4e+32) {
tmp = t_4 * ((0.5 * (x + (t * (t * t_2)))) - y);
} else if ((t * t) <= 2e+107) {
tmp = t_4 * ((0.5 * (((x * x) - (t_1 * t_1)) / (x + t_1))) - y);
} else if ((t * t) <= 2e+121) {
tmp = t_4 * ((0.5 * (x + (t * (x * (0.5 * t))))) - y);
} else if ((t * t) <= 5e+279) {
tmp = t_4 * (y * (((t_3 * t_3) + -1.0) / (1.0 - t_3)));
} else {
tmp = t_2 * Math.sqrt(((2.0 * z) * ((t * t) + 1.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (t * (y - (x * 0.5))) t_2 = (x * 0.5) - y t_3 = 0.5 * (t * t) t_4 = math.sqrt((2.0 * z)) tmp = 0 if (t * t) <= 4e+32: tmp = t_4 * ((0.5 * (x + (t * (t * t_2)))) - y) elif (t * t) <= 2e+107: tmp = t_4 * ((0.5 * (((x * x) - (t_1 * t_1)) / (x + t_1))) - y) elif (t * t) <= 2e+121: tmp = t_4 * ((0.5 * (x + (t * (x * (0.5 * t))))) - y) elif (t * t) <= 5e+279: tmp = t_4 * (y * (((t_3 * t_3) + -1.0) / (1.0 - t_3))) else: tmp = t_2 * math.sqrt(((2.0 * z) * ((t * t) + 1.0))) return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(t * Float64(y - Float64(x * 0.5)))) t_2 = Float64(Float64(x * 0.5) - y) t_3 = Float64(0.5 * Float64(t * t)) t_4 = sqrt(Float64(2.0 * z)) tmp = 0.0 if (Float64(t * t) <= 4e+32) tmp = Float64(t_4 * Float64(Float64(0.5 * Float64(x + Float64(t * Float64(t * t_2)))) - y)); elseif (Float64(t * t) <= 2e+107) tmp = Float64(t_4 * Float64(Float64(0.5 * Float64(Float64(Float64(x * x) - Float64(t_1 * t_1)) / Float64(x + t_1))) - y)); elseif (Float64(t * t) <= 2e+121) tmp = Float64(t_4 * Float64(Float64(0.5 * Float64(x + Float64(t * Float64(x * Float64(0.5 * t))))) - y)); elseif (Float64(t * t) <= 5e+279) tmp = Float64(t_4 * Float64(y * Float64(Float64(Float64(t_3 * t_3) + -1.0) / Float64(1.0 - t_3)))); else tmp = Float64(t_2 * sqrt(Float64(Float64(2.0 * z) * Float64(Float64(t * t) + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (t * (y - (x * 0.5))); t_2 = (x * 0.5) - y; t_3 = 0.5 * (t * t); t_4 = sqrt((2.0 * z)); tmp = 0.0; if ((t * t) <= 4e+32) tmp = t_4 * ((0.5 * (x + (t * (t * t_2)))) - y); elseif ((t * t) <= 2e+107) tmp = t_4 * ((0.5 * (((x * x) - (t_1 * t_1)) / (x + t_1))) - y); elseif ((t * t) <= 2e+121) tmp = t_4 * ((0.5 * (x + (t * (x * (0.5 * t))))) - y); elseif ((t * t) <= 5e+279) tmp = t_4 * (y * (((t_3 * t_3) + -1.0) / (1.0 - t_3))); else tmp = t_2 * sqrt(((2.0 * z) * ((t * t) + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(t * N[(y - N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$3 = N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 4e+32], N[(t$95$4 * N[(N[(0.5 * N[(x + N[(t * N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 2e+107], N[(t$95$4 * N[(N[(0.5 * N[(N[(N[(x * x), $MachinePrecision] - N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 2e+121], N[(t$95$4 * N[(N[(0.5 * N[(x + N[(t * N[(x * N[(0.5 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 5e+279], N[(t$95$4 * N[(y * N[(N[(N[(t$95$3 * t$95$3), $MachinePrecision] + -1.0), $MachinePrecision] / N[(1.0 - t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(t \cdot \left(y - x \cdot 0.5\right)\right)\\
t_2 := x \cdot 0.5 - y\\
t_3 := 0.5 \cdot \left(t \cdot t\right)\\
t_4 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t \cdot t \leq 4 \cdot 10^{+32}:\\
\;\;\;\;t_4 \cdot \left(0.5 \cdot \left(x + t \cdot \left(t \cdot t_2\right)\right) - y\right)\\
\mathbf{elif}\;t \cdot t \leq 2 \cdot 10^{+107}:\\
\;\;\;\;t_4 \cdot \left(0.5 \cdot \frac{x \cdot x - t_1 \cdot t_1}{x + t_1} - y\right)\\
\mathbf{elif}\;t \cdot t \leq 2 \cdot 10^{+121}:\\
\;\;\;\;t_4 \cdot \left(0.5 \cdot \left(x + t \cdot \left(x \cdot \left(0.5 \cdot t\right)\right)\right) - y\right)\\
\mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+279}:\\
\;\;\;\;t_4 \cdot \left(y \cdot \frac{t_3 \cdot t_3 + -1}{1 - t_3}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sqrt{\left(2 \cdot z\right) \cdot \left(t \cdot t + 1\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 4.00000000000000021e32Initial program 99.7%
sqr-neg99.7%
associate-/l*99.7%
distribute-frac-neg99.7%
exp-neg99.7%
associate-*r/99.7%
*-rgt-identity99.7%
*-commutative99.7%
associate-*r/99.7%
*-rgt-identity99.7%
associate-*r/99.7%
exp-neg99.7%
distribute-frac-neg99.7%
associate-/l*99.7%
sqr-neg99.7%
Simplified99.7%
Taylor expanded in t around 0 95.6%
distribute-lft-out95.6%
unpow295.6%
Simplified95.6%
Taylor expanded in t around 0 95.6%
unpow295.6%
*-commutative95.6%
associate-*r*95.6%
*-commutative95.6%
Simplified95.6%
if 4.00000000000000021e32 < (*.f64 t t) < 1.9999999999999999e107Initial program 100.0%
sqr-neg100.0%
associate-/l*100.0%
distribute-frac-neg100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
*-commutative100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
exp-neg100.0%
distribute-frac-neg100.0%
associate-/l*100.0%
sqr-neg100.0%
Simplified100.0%
Taylor expanded in t around 0 12.0%
distribute-lft-out12.0%
unpow212.0%
Simplified12.0%
flip-+41.7%
associate-*l*41.7%
*-commutative41.7%
associate-*l*41.7%
*-commutative41.7%
associate-*l*41.7%
*-commutative41.7%
Applied egg-rr41.7%
if 1.9999999999999999e107 < (*.f64 t t) < 2.00000000000000007e121Initial program 100.0%
sqr-neg100.0%
associate-/l*100.0%
distribute-frac-neg100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
*-commutative100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
exp-neg100.0%
distribute-frac-neg100.0%
associate-/l*100.0%
sqr-neg100.0%
Simplified100.0%
Taylor expanded in t around 0 76.5%
distribute-lft-out76.5%
unpow276.5%
Simplified76.5%
Taylor expanded in t around 0 76.5%
unpow276.5%
*-commutative76.5%
associate-*r*76.5%
*-commutative76.5%
Simplified76.5%
Taylor expanded in x around inf 76.5%
associate-*r*76.5%
Simplified76.5%
if 2.00000000000000007e121 < (*.f64 t t) < 5.0000000000000002e279Initial program 97.3%
sqr-neg97.3%
associate-/l*97.3%
distribute-frac-neg97.3%
exp-neg97.3%
associate-*r/97.3%
*-rgt-identity97.3%
*-commutative97.3%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
exp-neg100.0%
distribute-frac-neg100.0%
associate-/l*100.0%
sqr-neg100.0%
Simplified100.0%
Taylor expanded in t around 0 46.1%
distribute-lft-out46.1%
unpow246.1%
Simplified46.1%
Taylor expanded in y around -inf 32.6%
associate-*r*32.6%
neg-mul-132.6%
*-commutative32.6%
unpow232.6%
Simplified32.6%
flip-+91.9%
metadata-eval91.9%
*-commutative91.9%
*-commutative91.9%
*-commutative91.9%
Applied egg-rr91.9%
if 5.0000000000000002e279 < (*.f64 t t) Initial program 100.0%
sqr-neg100.0%
associate-/l*100.0%
distribute-frac-neg100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
exp-neg100.0%
distribute-frac-neg100.0%
associate-/l*100.0%
sqr-neg100.0%
exp-sqrt100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
pow-exp100.0%
sqrt-unprod100.0%
associate-*l*100.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 98.5%
+-commutative98.5%
unpow298.5%
Simplified98.5%
Final simplification92.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.5 (* t t))) (t_2 (- (* x 0.5) y)) (t_3 (sqrt (* 2.0 z))))
(if (<= (* t t) 2e+121)
(* t_3 (- (* 0.5 (+ x (* t (* t t_2)))) y))
(if (<= (* t t) 5e+279)
(* t_3 (* y (/ (+ (* t_1 t_1) -1.0) (- 1.0 t_1))))
(* t_2 (sqrt (* (* 2.0 z) (+ (* t t) 1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * (t * t);
double t_2 = (x * 0.5) - y;
double t_3 = sqrt((2.0 * z));
double tmp;
if ((t * t) <= 2e+121) {
tmp = t_3 * ((0.5 * (x + (t * (t * t_2)))) - y);
} else if ((t * t) <= 5e+279) {
tmp = t_3 * (y * (((t_1 * t_1) + -1.0) / (1.0 - t_1)));
} else {
tmp = t_2 * sqrt(((2.0 * z) * ((t * t) + 1.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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 0.5d0 * (t * t)
t_2 = (x * 0.5d0) - y
t_3 = sqrt((2.0d0 * z))
if ((t * t) <= 2d+121) then
tmp = t_3 * ((0.5d0 * (x + (t * (t * t_2)))) - y)
else if ((t * t) <= 5d+279) then
tmp = t_3 * (y * (((t_1 * t_1) + (-1.0d0)) / (1.0d0 - t_1)))
else
tmp = t_2 * sqrt(((2.0d0 * z) * ((t * t) + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 0.5 * (t * t);
double t_2 = (x * 0.5) - y;
double t_3 = Math.sqrt((2.0 * z));
double tmp;
if ((t * t) <= 2e+121) {
tmp = t_3 * ((0.5 * (x + (t * (t * t_2)))) - y);
} else if ((t * t) <= 5e+279) {
tmp = t_3 * (y * (((t_1 * t_1) + -1.0) / (1.0 - t_1)));
} else {
tmp = t_2 * Math.sqrt(((2.0 * z) * ((t * t) + 1.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = 0.5 * (t * t) t_2 = (x * 0.5) - y t_3 = math.sqrt((2.0 * z)) tmp = 0 if (t * t) <= 2e+121: tmp = t_3 * ((0.5 * (x + (t * (t * t_2)))) - y) elif (t * t) <= 5e+279: tmp = t_3 * (y * (((t_1 * t_1) + -1.0) / (1.0 - t_1))) else: tmp = t_2 * math.sqrt(((2.0 * z) * ((t * t) + 1.0))) return tmp
function code(x, y, z, t) t_1 = Float64(0.5 * Float64(t * t)) t_2 = Float64(Float64(x * 0.5) - y) t_3 = sqrt(Float64(2.0 * z)) tmp = 0.0 if (Float64(t * t) <= 2e+121) tmp = Float64(t_3 * Float64(Float64(0.5 * Float64(x + Float64(t * Float64(t * t_2)))) - y)); elseif (Float64(t * t) <= 5e+279) tmp = Float64(t_3 * Float64(y * Float64(Float64(Float64(t_1 * t_1) + -1.0) / Float64(1.0 - t_1)))); else tmp = Float64(t_2 * sqrt(Float64(Float64(2.0 * z) * Float64(Float64(t * t) + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 0.5 * (t * t); t_2 = (x * 0.5) - y; t_3 = sqrt((2.0 * z)); tmp = 0.0; if ((t * t) <= 2e+121) tmp = t_3 * ((0.5 * (x + (t * (t * t_2)))) - y); elseif ((t * t) <= 5e+279) tmp = t_3 * (y * (((t_1 * t_1) + -1.0) / (1.0 - t_1))); else tmp = t_2 * sqrt(((2.0 * z) * ((t * t) + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 2e+121], N[(t$95$3 * N[(N[(0.5 * N[(x + N[(t * N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 5e+279], N[(t$95$3 * N[(y * N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] + -1.0), $MachinePrecision] / N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.5 \cdot \left(t \cdot t\right)\\
t_2 := x \cdot 0.5 - y\\
t_3 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t \cdot t \leq 2 \cdot 10^{+121}:\\
\;\;\;\;t_3 \cdot \left(0.5 \cdot \left(x + t \cdot \left(t \cdot t_2\right)\right) - y\right)\\
\mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+279}:\\
\;\;\;\;t_3 \cdot \left(y \cdot \frac{t_1 \cdot t_1 + -1}{1 - t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \sqrt{\left(2 \cdot z\right) \cdot \left(t \cdot t + 1\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 2.00000000000000007e121Initial program 99.7%
sqr-neg99.7%
associate-/l*99.7%
distribute-frac-neg99.7%
exp-neg99.7%
associate-*r/99.7%
*-rgt-identity99.7%
*-commutative99.7%
associate-*r/99.7%
*-rgt-identity99.7%
associate-*r/99.7%
exp-neg99.7%
distribute-frac-neg99.7%
associate-/l*99.7%
sqr-neg99.7%
Simplified99.7%
Taylor expanded in t around 0 86.9%
distribute-lft-out86.9%
unpow286.9%
Simplified86.9%
Taylor expanded in t around 0 86.9%
unpow286.9%
*-commutative86.9%
associate-*r*86.9%
*-commutative86.9%
Simplified86.9%
if 2.00000000000000007e121 < (*.f64 t t) < 5.0000000000000002e279Initial program 97.3%
sqr-neg97.3%
associate-/l*97.3%
distribute-frac-neg97.3%
exp-neg97.3%
associate-*r/97.3%
*-rgt-identity97.3%
*-commutative97.3%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
exp-neg100.0%
distribute-frac-neg100.0%
associate-/l*100.0%
sqr-neg100.0%
Simplified100.0%
Taylor expanded in t around 0 46.1%
distribute-lft-out46.1%
unpow246.1%
Simplified46.1%
Taylor expanded in y around -inf 32.6%
associate-*r*32.6%
neg-mul-132.6%
*-commutative32.6%
unpow232.6%
Simplified32.6%
flip-+91.9%
metadata-eval91.9%
*-commutative91.9%
*-commutative91.9%
*-commutative91.9%
Applied egg-rr91.9%
if 5.0000000000000002e279 < (*.f64 t t) Initial program 100.0%
sqr-neg100.0%
associate-/l*100.0%
distribute-frac-neg100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
exp-neg100.0%
distribute-frac-neg100.0%
associate-/l*100.0%
sqr-neg100.0%
exp-sqrt100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
pow-exp100.0%
sqrt-unprod100.0%
associate-*l*100.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 98.5%
+-commutative98.5%
unpow298.5%
Simplified98.5%
Final simplification90.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= (* 2.0 z) 5e+73)
(* (sqrt (* 2.0 z)) (- (* 0.5 (+ x (* t (* t t_1)))) y))
(* t_1 (sqrt (* (* 2.0 z) (+ (* t t) 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if ((2.0 * z) <= 5e+73) {
tmp = sqrt((2.0 * z)) * ((0.5 * (x + (t * (t * t_1)))) - y);
} else {
tmp = t_1 * sqrt(((2.0 * z) * ((t * t) + 1.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 ((2.0d0 * z) <= 5d+73) then
tmp = sqrt((2.0d0 * z)) * ((0.5d0 * (x + (t * (t * t_1)))) - y)
else
tmp = t_1 * sqrt(((2.0d0 * z) * ((t * t) + 1.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 ((2.0 * z) <= 5e+73) {
tmp = Math.sqrt((2.0 * z)) * ((0.5 * (x + (t * (t * t_1)))) - y);
} else {
tmp = t_1 * Math.sqrt(((2.0 * z) * ((t * t) + 1.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if (2.0 * z) <= 5e+73: tmp = math.sqrt((2.0 * z)) * ((0.5 * (x + (t * (t * t_1)))) - y) else: tmp = t_1 * math.sqrt(((2.0 * z) * ((t * t) + 1.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (Float64(2.0 * z) <= 5e+73) tmp = Float64(sqrt(Float64(2.0 * z)) * Float64(Float64(0.5 * Float64(x + Float64(t * Float64(t * t_1)))) - y)); else tmp = Float64(t_1 * sqrt(Float64(Float64(2.0 * z) * Float64(Float64(t * t) + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if ((2.0 * z) <= 5e+73) tmp = sqrt((2.0 * z)) * ((0.5 * (x + (t * (t * t_1)))) - y); else tmp = t_1 * sqrt(((2.0 * z) * ((t * t) + 1.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[N[(2.0 * z), $MachinePrecision], 5e+73], N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * N[(x + N[(t * N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;2 \cdot z \leq 5 \cdot 10^{+73}:\\
\;\;\;\;\sqrt{2 \cdot z} \cdot \left(0.5 \cdot \left(x + t \cdot \left(t \cdot t_1\right)\right) - y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sqrt{\left(2 \cdot z\right) \cdot \left(t \cdot t + 1\right)}\\
\end{array}
\end{array}
if (*.f64 z 2) < 4.99999999999999976e73Initial program 99.1%
sqr-neg99.1%
associate-/l*99.1%
distribute-frac-neg99.1%
exp-neg99.1%
associate-*r/99.1%
*-rgt-identity99.1%
*-commutative99.1%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 83.2%
distribute-lft-out83.2%
unpow283.2%
Simplified83.2%
Taylor expanded in t around 0 83.2%
unpow283.2%
*-commutative83.2%
associate-*r*83.2%
*-commutative83.2%
Simplified83.2%
if 4.99999999999999976e73 < (*.f64 z 2) Initial program 99.9%
sqr-neg99.9%
associate-/l*99.9%
distribute-frac-neg99.9%
exp-neg99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
exp-neg99.9%
distribute-frac-neg99.9%
associate-/l*99.9%
sqr-neg99.9%
exp-sqrt99.9%
Simplified99.9%
expm1-log1p-u96.7%
expm1-udef96.7%
pow-exp96.7%
sqrt-unprod96.7%
associate-*l*96.7%
Applied egg-rr96.7%
expm1-def96.7%
expm1-log1p99.9%
associate-*r*99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around 0 92.4%
+-commutative92.4%
unpow292.4%
Simplified92.4%
Final simplification87.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= (* 2.0 z) 2e+99)
(* (sqrt (* 2.0 z)) (- (* 0.5 (+ x (* (* t t) t_1))) y))
(* t_1 (sqrt (* (* 2.0 z) (+ (* t t) 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if ((2.0 * z) <= 2e+99) {
tmp = sqrt((2.0 * z)) * ((0.5 * (x + ((t * t) * t_1))) - y);
} else {
tmp = t_1 * sqrt(((2.0 * z) * ((t * t) + 1.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 ((2.0d0 * z) <= 2d+99) then
tmp = sqrt((2.0d0 * z)) * ((0.5d0 * (x + ((t * t) * t_1))) - y)
else
tmp = t_1 * sqrt(((2.0d0 * z) * ((t * t) + 1.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 ((2.0 * z) <= 2e+99) {
tmp = Math.sqrt((2.0 * z)) * ((0.5 * (x + ((t * t) * t_1))) - y);
} else {
tmp = t_1 * Math.sqrt(((2.0 * z) * ((t * t) + 1.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if (2.0 * z) <= 2e+99: tmp = math.sqrt((2.0 * z)) * ((0.5 * (x + ((t * t) * t_1))) - y) else: tmp = t_1 * math.sqrt(((2.0 * z) * ((t * t) + 1.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (Float64(2.0 * z) <= 2e+99) tmp = Float64(sqrt(Float64(2.0 * z)) * Float64(Float64(0.5 * Float64(x + Float64(Float64(t * t) * t_1))) - y)); else tmp = Float64(t_1 * sqrt(Float64(Float64(2.0 * z) * Float64(Float64(t * t) + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if ((2.0 * z) <= 2e+99) tmp = sqrt((2.0 * z)) * ((0.5 * (x + ((t * t) * t_1))) - y); else tmp = t_1 * sqrt(((2.0 * z) * ((t * t) + 1.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[N[(2.0 * z), $MachinePrecision], 2e+99], N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * N[(x + N[(N[(t * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;2 \cdot z \leq 2 \cdot 10^{+99}:\\
\;\;\;\;\sqrt{2 \cdot z} \cdot \left(0.5 \cdot \left(x + \left(t \cdot t\right) \cdot t_1\right) - y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sqrt{\left(2 \cdot z\right) \cdot \left(t \cdot t + 1\right)}\\
\end{array}
\end{array}
if (*.f64 z 2) < 1.9999999999999999e99Initial program 99.2%
sqr-neg99.2%
associate-/l*99.2%
distribute-frac-neg99.2%
exp-neg99.2%
associate-*r/99.2%
*-rgt-identity99.2%
*-commutative99.2%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 83.4%
distribute-lft-out83.4%
unpow283.4%
Simplified83.4%
if 1.9999999999999999e99 < (*.f64 z 2) Initial program 99.8%
sqr-neg99.8%
associate-/l*99.8%
distribute-frac-neg99.8%
exp-neg99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
exp-sqrt99.8%
Simplified99.8%
expm1-log1p-u96.7%
expm1-udef96.7%
pow-exp96.7%
sqrt-unprod96.7%
associate-*l*96.7%
Applied egg-rr96.7%
expm1-def96.7%
expm1-log1p99.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 93.3%
+-commutative93.3%
unpow293.3%
Simplified93.3%
Final simplification87.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))))
(if (<= (* t t) 2e+121)
(* t_1 (- (* x 0.5) y))
(* t_1 (- (* y (* (* t t) -0.5)) y)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double tmp;
if ((t * t) <= 2e+121) {
tmp = t_1 * ((x * 0.5) - y);
} else {
tmp = t_1 * ((y * ((t * t) * -0.5)) - y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((2.0d0 * z))
if ((t * t) <= 2d+121) then
tmp = t_1 * ((x * 0.5d0) - y)
else
tmp = t_1 * ((y * ((t * t) * (-0.5d0))) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((2.0 * z));
double tmp;
if ((t * t) <= 2e+121) {
tmp = t_1 * ((x * 0.5) - y);
} else {
tmp = t_1 * ((y * ((t * t) * -0.5)) - y);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) tmp = 0 if (t * t) <= 2e+121: tmp = t_1 * ((x * 0.5) - y) else: tmp = t_1 * ((y * ((t * t) * -0.5)) - y) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) tmp = 0.0 if (Float64(t * t) <= 2e+121) tmp = Float64(t_1 * Float64(Float64(x * 0.5) - y)); else tmp = Float64(t_1 * Float64(Float64(y * Float64(Float64(t * t) * -0.5)) - y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); tmp = 0.0; if ((t * t) <= 2e+121) tmp = t_1 * ((x * 0.5) - y); else tmp = t_1 * ((y * ((t * t) * -0.5)) - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 2e+121], N[(t$95$1 * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(y * N[(N[(t * t), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t \cdot t \leq 2 \cdot 10^{+121}:\\
\;\;\;\;t_1 \cdot \left(x \cdot 0.5 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(y \cdot \left(\left(t \cdot t\right) \cdot -0.5\right) - y\right)\\
\end{array}
\end{array}
if (*.f64 t t) < 2.00000000000000007e121Initial program 99.7%
sqr-neg99.7%
associate-/l*99.7%
distribute-frac-neg99.7%
exp-neg99.7%
associate-*r/99.7%
*-rgt-identity99.7%
*-commutative99.7%
associate-*r/99.7%
*-rgt-identity99.7%
associate-*r/99.7%
exp-neg99.7%
distribute-frac-neg99.7%
associate-/l*99.7%
sqr-neg99.7%
Simplified99.7%
Taylor expanded in t around 0 83.8%
if 2.00000000000000007e121 < (*.f64 t t) Initial program 99.0%
sqr-neg99.0%
associate-/l*99.0%
distribute-frac-neg99.0%
exp-neg99.0%
associate-*r/99.0%
*-rgt-identity99.0%
*-commutative99.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
exp-neg100.0%
distribute-frac-neg100.0%
associate-/l*100.0%
sqr-neg100.0%
Simplified100.0%
Taylor expanded in t around 0 77.9%
distribute-lft-out77.9%
unpow277.9%
Simplified77.9%
Taylor expanded in t around 0 77.9%
unpow277.9%
*-commutative77.9%
associate-*r*74.3%
*-commutative74.3%
Simplified74.3%
Taylor expanded in x around 0 52.1%
mul-1-neg52.1%
*-commutative52.1%
distribute-rgt-neg-in52.1%
Simplified52.1%
Taylor expanded in x around 0 57.4%
associate-*r*57.4%
*-commutative57.4%
unpow257.4%
Simplified57.4%
Final simplification73.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))))
(if (<= (* t t) 2e+121)
(* t_1 (- (* x 0.5) y))
(* t_1 (* y (* t (* t -0.5)))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double tmp;
if ((t * t) <= 2e+121) {
tmp = t_1 * ((x * 0.5) - y);
} else {
tmp = t_1 * (y * (t * (t * -0.5)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((2.0d0 * z))
if ((t * t) <= 2d+121) then
tmp = t_1 * ((x * 0.5d0) - y)
else
tmp = t_1 * (y * (t * (t * (-0.5d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((2.0 * z));
double tmp;
if ((t * t) <= 2e+121) {
tmp = t_1 * ((x * 0.5) - y);
} else {
tmp = t_1 * (y * (t * (t * -0.5)));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) tmp = 0 if (t * t) <= 2e+121: tmp = t_1 * ((x * 0.5) - y) else: tmp = t_1 * (y * (t * (t * -0.5))) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) tmp = 0.0 if (Float64(t * t) <= 2e+121) tmp = Float64(t_1 * Float64(Float64(x * 0.5) - y)); else tmp = Float64(t_1 * Float64(y * Float64(t * Float64(t * -0.5)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); tmp = 0.0; if ((t * t) <= 2e+121) tmp = t_1 * ((x * 0.5) - y); else tmp = t_1 * (y * (t * (t * -0.5))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 2e+121], N[(t$95$1 * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(y * N[(t * N[(t * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;t \cdot t \leq 2 \cdot 10^{+121}:\\
\;\;\;\;t_1 \cdot \left(x \cdot 0.5 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(y \cdot \left(t \cdot \left(t \cdot -0.5\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 t t) < 2.00000000000000007e121Initial program 99.7%
sqr-neg99.7%
associate-/l*99.7%
distribute-frac-neg99.7%
exp-neg99.7%
associate-*r/99.7%
*-rgt-identity99.7%
*-commutative99.7%
associate-*r/99.7%
*-rgt-identity99.7%
associate-*r/99.7%
exp-neg99.7%
distribute-frac-neg99.7%
associate-/l*99.7%
sqr-neg99.7%
Simplified99.7%
Taylor expanded in t around 0 83.8%
if 2.00000000000000007e121 < (*.f64 t t) Initial program 99.0%
sqr-neg99.0%
associate-/l*99.0%
distribute-frac-neg99.0%
exp-neg99.0%
associate-*r/99.0%
*-rgt-identity99.0%
*-commutative99.0%
associate-*r/100.0%
*-rgt-identity100.0%
associate-*r/100.0%
exp-neg100.0%
distribute-frac-neg100.0%
associate-/l*100.0%
sqr-neg100.0%
Simplified100.0%
Taylor expanded in t around 0 77.9%
distribute-lft-out77.9%
unpow277.9%
Simplified77.9%
Taylor expanded in y around -inf 57.4%
associate-*r*57.4%
neg-mul-157.4%
*-commutative57.4%
unpow257.4%
Simplified57.4%
Taylor expanded in t around inf 57.4%
associate-*r*57.4%
*-commutative57.4%
unpow257.4%
associate-*r*57.4%
Simplified57.4%
Final simplification73.2%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (+ (* t t) 1.0)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((2.0 * z) * ((t * t) + 1.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) * ((t * t) + 1.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) * ((t * t) + 1.0)));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((2.0 * z) * ((t * t) + 1.0)))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) * Float64(Float64(t * t) + 1.0)))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) * ((t * t) + 1.0))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \left(t \cdot t + 1\right)}
\end{array}
Initial program 99.4%
sqr-neg99.4%
associate-/l*99.4%
distribute-frac-neg99.4%
exp-neg99.5%
associate-*r/99.5%
*-rgt-identity99.5%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
exp-sqrt99.8%
Simplified99.8%
expm1-log1p-u98.3%
expm1-udef80.4%
pow-exp80.4%
sqrt-unprod80.4%
associate-*l*80.4%
Applied egg-rr80.4%
expm1-def98.3%
expm1-log1p99.8%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 83.9%
+-commutative83.9%
unpow283.9%
Simplified83.9%
Final simplification83.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* 2.0 z))))
(if (or (<= y -1.25e+30) (not (<= y 6.8e-29)))
(* t_1 (- y))
(* t_1 (* x 0.5)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((2.0 * z));
double tmp;
if ((y <= -1.25e+30) || !(y <= 6.8e-29)) {
tmp = t_1 * -y;
} else {
tmp = t_1 * (x * 0.5);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((2.0d0 * z))
if ((y <= (-1.25d+30)) .or. (.not. (y <= 6.8d-29))) then
tmp = t_1 * -y
else
tmp = t_1 * (x * 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((2.0 * z));
double tmp;
if ((y <= -1.25e+30) || !(y <= 6.8e-29)) {
tmp = t_1 * -y;
} else {
tmp = t_1 * (x * 0.5);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((2.0 * z)) tmp = 0 if (y <= -1.25e+30) or not (y <= 6.8e-29): tmp = t_1 * -y else: tmp = t_1 * (x * 0.5) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(2.0 * z)) tmp = 0.0 if ((y <= -1.25e+30) || !(y <= 6.8e-29)) tmp = Float64(t_1 * Float64(-y)); else tmp = Float64(t_1 * Float64(x * 0.5)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((2.0 * z)); tmp = 0.0; if ((y <= -1.25e+30) || ~((y <= 6.8e-29))) tmp = t_1 * -y; else tmp = t_1 * (x * 0.5); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y, -1.25e+30], N[Not[LessEqual[y, 6.8e-29]], $MachinePrecision]], N[(t$95$1 * (-y)), $MachinePrecision], N[(t$95$1 * N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot z}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+30} \lor \neg \left(y \leq 6.8 \cdot 10^{-29}\right):\\
\;\;\;\;t_1 \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(x \cdot 0.5\right)\\
\end{array}
\end{array}
if y < -1.25e30 or 6.79999999999999945e-29 < y Initial program 99.9%
sqr-neg99.9%
associate-/l*99.9%
distribute-frac-neg99.9%
exp-neg99.9%
associate-*r/99.9%
*-rgt-identity99.9%
*-commutative99.9%
associate-*r/99.9%
*-rgt-identity99.9%
associate-*r/99.9%
exp-neg99.9%
distribute-frac-neg99.9%
associate-/l*99.9%
sqr-neg99.9%
Simplified99.9%
Taylor expanded in t around 0 87.4%
distribute-lft-out87.4%
unpow287.4%
Simplified87.4%
Taylor expanded in y around -inf 71.7%
associate-*r*71.7%
neg-mul-171.7%
*-commutative71.7%
unpow271.7%
Simplified71.7%
Taylor expanded in t around 0 45.2%
neg-mul-145.2%
Simplified45.2%
if -1.25e30 < y < 6.79999999999999945e-29Initial program 99.0%
sqr-neg99.0%
associate-/l*99.0%
distribute-frac-neg99.0%
exp-neg99.0%
associate-*r/99.0%
*-rgt-identity99.0%
*-commutative99.0%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 55.6%
Taylor expanded in x around inf 42.9%
*-commutative42.9%
*-commutative42.9%
associate-*l*42.9%
*-commutative42.9%
associate-*l*42.9%
*-commutative42.9%
Simplified42.9%
pow142.9%
associate-*r*42.9%
sqrt-prod43.0%
*-commutative43.0%
*-commutative43.0%
Applied egg-rr43.0%
unpow143.0%
*-commutative43.0%
*-commutative43.0%
Simplified43.0%
Final simplification44.0%
(FPCore (x y z t) :precision binary64 (* (sqrt (* 2.0 z)) (- (* x 0.5) y)))
double code(double x, double y, double z, double t) {
return sqrt((2.0 * z)) * ((x * 0.5) - y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((2.0d0 * z)) * ((x * 0.5d0) - y)
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((2.0 * z)) * ((x * 0.5) - y);
}
def code(x, y, z, t): return math.sqrt((2.0 * z)) * ((x * 0.5) - y)
function code(x, y, z, t) return Float64(sqrt(Float64(2.0 * z)) * Float64(Float64(x * 0.5) - y)) end
function tmp = code(x, y, z, t) tmp = sqrt((2.0 * z)) * ((x * 0.5) - y); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot z} \cdot \left(x \cdot 0.5 - y\right)
\end{array}
Initial program 99.4%
sqr-neg99.4%
associate-/l*99.4%
distribute-frac-neg99.4%
exp-neg99.5%
associate-*r/99.5%
*-rgt-identity99.5%
*-commutative99.5%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 55.5%
Final simplification55.5%
(FPCore (x y z t) :precision binary64 (* (sqrt (* 2.0 z)) (- y)))
double code(double x, double y, double z, double t) {
return sqrt((2.0 * z)) * -y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((2.0d0 * z)) * -y
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((2.0 * z)) * -y;
}
def code(x, y, z, t): return math.sqrt((2.0 * z)) * -y
function code(x, y, z, t) return Float64(sqrt(Float64(2.0 * z)) * Float64(-y)) end
function tmp = code(x, y, z, t) tmp = sqrt((2.0 * z)) * -y; end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{2 \cdot z} \cdot \left(-y\right)
\end{array}
Initial program 99.4%
sqr-neg99.4%
associate-/l*99.4%
distribute-frac-neg99.4%
exp-neg99.5%
associate-*r/99.5%
*-rgt-identity99.5%
*-commutative99.5%
associate-*r/99.8%
*-rgt-identity99.8%
associate-*r/99.8%
exp-neg99.8%
distribute-frac-neg99.8%
associate-/l*99.8%
sqr-neg99.8%
Simplified99.8%
Taylor expanded in t around 0 83.3%
distribute-lft-out83.3%
unpow283.3%
Simplified83.3%
Taylor expanded in y around -inf 47.9%
associate-*r*47.9%
neg-mul-147.9%
*-commutative47.9%
unpow247.9%
Simplified47.9%
Taylor expanded in t around 0 28.4%
neg-mul-128.4%
Simplified28.4%
Final simplification28.4%
(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 2023275
(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))))