
(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}
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (pow E (* t t)) (* 2.0 z)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt((pow(((double) M_E), (t * t)) * (2.0 * z)));
}
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt((Math.pow(Math.E, (t * t)) * (2.0 * z)));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt((math.pow(math.e, (t * t)) * (2.0 * z)))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64((exp(1) ^ Float64(t * t)) * Float64(2.0 * z)))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((2.71828182845904523536 ^ (t * t)) * (2.0 * z))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[Power[E, N[(t * t), $MachinePrecision]], $MachinePrecision] * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{{e}^{\left(t \cdot t\right)} \cdot \left(2 \cdot z\right)}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
expm1-log1p-u98.7%
expm1-udef74.9%
pow-exp74.9%
sqrt-unprod74.9%
Applied egg-rr74.9%
expm1-def98.7%
expm1-log1p99.8%
*-commutative99.8%
exp-prod99.8%
Simplified99.8%
*-un-lft-identity99.8%
exp-prod99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (pow (exp t) t)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((2.0 * z) * pow(exp(t), t)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * 0.5d0) - y) * sqrt(((2.0d0 * z) * (exp(t) ** t)))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt(((2.0 * z) * Math.pow(Math.exp(t), t)));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((2.0 * z) * math.pow(math.exp(t), t)))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) * (exp(t) ^ t)))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) * (exp(t) ^ t))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[Power[N[Exp[t], $MachinePrecision], t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot {\left(e^{t}\right)}^{t}}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
pow-exp99.8%
sqrt-unprod99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (+ 1.0 (* 0.5 (* t t)))))
(t_2 (sqrt (* (* 2.0 z) (exp (* t t)))))
(t_3 (/ t_2 (/ -1.0 y))))
(if (<= (* t t) 50.0)
t_1
(if (<= (* t t) 4e+109)
t_3
(if (<= (* t t) 5e+159)
(/ t_2 (/ 2.0 x))
(if (<= (* t t) 1e+277) t_3 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (((x * 0.5) - y) * sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
double t_2 = sqrt(((2.0 * z) * exp((t * t))));
double t_3 = t_2 / (-1.0 / y);
double tmp;
if ((t * t) <= 50.0) {
tmp = t_1;
} else if ((t * t) <= 4e+109) {
tmp = t_3;
} else if ((t * t) <= 5e+159) {
tmp = t_2 / (2.0 / x);
} else if ((t * t) <= 1e+277) {
tmp = t_3;
} else {
tmp = t_1;
}
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 = (((x * 0.5d0) - y) * sqrt((2.0d0 * z))) * (1.0d0 + (0.5d0 * (t * t)))
t_2 = sqrt(((2.0d0 * z) * exp((t * t))))
t_3 = t_2 / ((-1.0d0) / y)
if ((t * t) <= 50.0d0) then
tmp = t_1
else if ((t * t) <= 4d+109) then
tmp = t_3
else if ((t * t) <= 5d+159) then
tmp = t_2 / (2.0d0 / x)
else if ((t * t) <= 1d+277) then
tmp = t_3
else
tmp = t_1
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) * Math.sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
double t_2 = Math.sqrt(((2.0 * z) * Math.exp((t * t))));
double t_3 = t_2 / (-1.0 / y);
double tmp;
if ((t * t) <= 50.0) {
tmp = t_1;
} else if ((t * t) <= 4e+109) {
tmp = t_3;
} else if ((t * t) <= 5e+159) {
tmp = t_2 / (2.0 / x);
} else if ((t * t) <= 1e+277) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (((x * 0.5) - y) * math.sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t))) t_2 = math.sqrt(((2.0 * z) * math.exp((t * t)))) t_3 = t_2 / (-1.0 / y) tmp = 0 if (t * t) <= 50.0: tmp = t_1 elif (t * t) <= 4e+109: tmp = t_3 elif (t * t) <= 5e+159: tmp = t_2 / (2.0 / x) elif (t * t) <= 1e+277: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))) * Float64(1.0 + Float64(0.5 * Float64(t * t)))) t_2 = sqrt(Float64(Float64(2.0 * z) * exp(Float64(t * t)))) t_3 = Float64(t_2 / Float64(-1.0 / y)) tmp = 0.0 if (Float64(t * t) <= 50.0) tmp = t_1; elseif (Float64(t * t) <= 4e+109) tmp = t_3; elseif (Float64(t * t) <= 5e+159) tmp = Float64(t_2 / Float64(2.0 / x)); elseif (Float64(t * t) <= 1e+277) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (((x * 0.5) - y) * sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t))); t_2 = sqrt(((2.0 * z) * exp((t * t)))); t_3 = t_2 / (-1.0 / y); tmp = 0.0; if ((t * t) <= 50.0) tmp = t_1; elseif ((t * t) <= 4e+109) tmp = t_3; elseif ((t * t) <= 5e+159) tmp = t_2 / (2.0 / x); elseif ((t * t) <= 1e+277) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[(-1.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 50.0], t$95$1, If[LessEqual[N[(t * t), $MachinePrecision], 4e+109], t$95$3, If[LessEqual[N[(t * t), $MachinePrecision], 5e+159], N[(t$95$2 / N[(2.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 1e+277], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right)\\
t_2 := \sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}\\
t_3 := \frac{t_2}{\frac{-1}{y}}\\
\mathbf{if}\;t \cdot t \leq 50:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \cdot t \leq 4 \cdot 10^{+109}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \cdot t \leq 5 \cdot 10^{+159}:\\
\;\;\;\;\frac{t_2}{\frac{2}{x}}\\
\mathbf{elif}\;t \cdot t \leq 10^{+277}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 t t) < 50 or 1e277 < (*.f64 t t) Initial program 99.7%
Taylor expanded in t around 0 99.1%
unpow299.1%
Simplified99.1%
if 50 < (*.f64 t t) < 3.99999999999999993e109 or 5.00000000000000003e159 < (*.f64 t t) < 1e277Initial program 97.9%
associate-*r*100.0%
exp-sqrt100.0%
*-commutative100.0%
flip--93.8%
associate-*r/93.8%
pow-exp93.8%
sqrt-unprod93.8%
swap-sqr93.8%
metadata-eval93.8%
fma-def93.8%
Applied egg-rr93.8%
associate-/l*93.8%
*-commutative93.8%
exp-prod93.8%
Simplified93.8%
Taylor expanded in x around 0 91.7%
if 3.99999999999999993e109 < (*.f64 t t) < 5.00000000000000003e159Initial program 100.0%
associate-*r*100.0%
exp-sqrt100.0%
*-commutative100.0%
flip--81.8%
associate-*r/81.8%
pow-exp81.8%
sqrt-unprod81.8%
swap-sqr81.8%
metadata-eval81.8%
fma-def81.8%
Applied egg-rr81.8%
associate-/l*81.8%
*-commutative81.8%
exp-prod81.8%
Simplified81.8%
Taylor expanded in x around inf 90.9%
Final simplification97.4%
(FPCore (x y z t) :precision binary64 (if (or (<= (* t t) 50.0) (not (<= (* t t) 1e+277))) (* (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (+ 1.0 (* 0.5 (* t t)))) (/ (sqrt (* (* 2.0 z) (exp (* t t)))) (/ -1.0 y))))
double code(double x, double y, double z, double t) {
double tmp;
if (((t * t) <= 50.0) || !((t * t) <= 1e+277)) {
tmp = (((x * 0.5) - y) * sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
} else {
tmp = sqrt(((2.0 * z) * exp((t * t)))) / (-1.0 / 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) :: tmp
if (((t * t) <= 50.0d0) .or. (.not. ((t * t) <= 1d+277))) then
tmp = (((x * 0.5d0) - y) * sqrt((2.0d0 * z))) * (1.0d0 + (0.5d0 * (t * t)))
else
tmp = sqrt(((2.0d0 * z) * exp((t * t)))) / ((-1.0d0) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((t * t) <= 50.0) || !((t * t) <= 1e+277)) {
tmp = (((x * 0.5) - y) * Math.sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
} else {
tmp = Math.sqrt(((2.0 * z) * Math.exp((t * t)))) / (-1.0 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((t * t) <= 50.0) or not ((t * t) <= 1e+277): tmp = (((x * 0.5) - y) * math.sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t))) else: tmp = math.sqrt(((2.0 * z) * math.exp((t * t)))) / (-1.0 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(t * t) <= 50.0) || !(Float64(t * t) <= 1e+277)) tmp = Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))) * Float64(1.0 + Float64(0.5 * Float64(t * t)))); else tmp = Float64(sqrt(Float64(Float64(2.0 * z) * exp(Float64(t * t)))) / Float64(-1.0 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((t * t) <= 50.0) || ~(((t * t) <= 1e+277))) tmp = (((x * 0.5) - y) * sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t))); else tmp = sqrt(((2.0 * z) * exp((t * t)))) / (-1.0 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(t * t), $MachinePrecision], 50.0], N[Not[LessEqual[N[(t * t), $MachinePrecision], 1e+277]], $MachinePrecision]], N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(-1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 50 \lor \neg \left(t \cdot t \leq 10^{+277}\right):\\
\;\;\;\;\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}}{\frac{-1}{y}}\\
\end{array}
\end{array}
if (*.f64 t t) < 50 or 1e277 < (*.f64 t t) Initial program 99.7%
Taylor expanded in t around 0 99.1%
unpow299.1%
Simplified99.1%
if 50 < (*.f64 t t) < 1e277Initial program 98.3%
associate-*r*100.0%
exp-sqrt100.0%
*-commutative100.0%
flip--91.5%
associate-*r/91.5%
pow-exp91.5%
sqrt-unprod91.5%
swap-sqr91.5%
metadata-eval91.5%
fma-def91.5%
Applied egg-rr91.5%
associate-/l*91.5%
*-commutative91.5%
exp-prod91.5%
Simplified91.5%
Taylor expanded in x around 0 83.1%
Final simplification95.4%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (exp (* t t))))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((2.0 * z) * exp((t * t))));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * 0.5d0) - y) * sqrt(((2.0d0 * z) * exp((t * t))))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt(((2.0 * z) * Math.exp((t * t))));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((2.0 * z) * math.exp((t * t))))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) * exp(Float64(t * t))))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) * exp((t * t)))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot e^{t \cdot t}}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
expm1-log1p-u98.7%
expm1-udef74.9%
pow-exp74.9%
sqrt-unprod74.9%
Applied egg-rr74.9%
expm1-def98.7%
expm1-log1p99.8%
*-commutative99.8%
exp-prod99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(if (<= (* t t) 4.2e+16)
(* (- (* x 0.5) y) (sqrt (* 2.0 z)))
(if (<= (* t t) 1.7e+154)
(sqrt (* (* y y) (+ z z)))
(/ (sqrt (* (* 2.0 z) (+ 1.0 (* t t)))) (/ 2.0 x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 4.2e+16) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else if ((t * t) <= 1.7e+154) {
tmp = sqrt(((y * y) * (z + z)));
} else {
tmp = sqrt(((2.0 * z) * (1.0 + (t * t)))) / (2.0 / x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t * t) <= 4.2d+16) then
tmp = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
else if ((t * t) <= 1.7d+154) then
tmp = sqrt(((y * y) * (z + z)))
else
tmp = sqrt(((2.0d0 * z) * (1.0d0 + (t * t)))) / (2.0d0 / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 4.2e+16) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else if ((t * t) <= 1.7e+154) {
tmp = Math.sqrt(((y * y) * (z + z)));
} else {
tmp = Math.sqrt(((2.0 * z) * (1.0 + (t * t)))) / (2.0 / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t * t) <= 4.2e+16: tmp = ((x * 0.5) - y) * math.sqrt((2.0 * z)) elif (t * t) <= 1.7e+154: tmp = math.sqrt(((y * y) * (z + z))) else: tmp = math.sqrt(((2.0 * z) * (1.0 + (t * t)))) / (2.0 / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(t * t) <= 4.2e+16) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); elseif (Float64(t * t) <= 1.7e+154) tmp = sqrt(Float64(Float64(y * y) * Float64(z + z))); else tmp = Float64(sqrt(Float64(Float64(2.0 * z) * Float64(1.0 + Float64(t * t)))) / Float64(2.0 / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t * t) <= 4.2e+16) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); elseif ((t * t) <= 1.7e+154) tmp = sqrt(((y * y) * (z + z))); else tmp = sqrt(((2.0 * z) * (1.0 + (t * t)))) / (2.0 / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(t * t), $MachinePrecision], 4.2e+16], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 1.7e+154], N[Sqrt[N[(N[(y * y), $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(1.0 + N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(2.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 4.2 \cdot 10^{+16}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{elif}\;t \cdot t \leq 1.7 \cdot 10^{+154}:\\
\;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot z\right) \cdot \left(1 + t \cdot t\right)}}{\frac{2}{x}}\\
\end{array}
\end{array}
if (*.f64 t t) < 4.2e16Initial program 99.6%
Taylor expanded in t around 0 96.2%
associate-*l*96.1%
Simplified96.1%
expm1-log1p-u60.7%
expm1-udef37.1%
*-commutative37.1%
*-commutative37.1%
associate-*r*37.1%
sqrt-prod37.1%
*-commutative37.1%
Applied egg-rr37.1%
expm1-def60.8%
expm1-log1p96.3%
*-commutative96.3%
*-commutative96.3%
*-commutative96.3%
Simplified96.3%
if 4.2e16 < (*.f64 t t) < 1.69999999999999987e154Initial program 96.4%
Taylor expanded in t around 0 15.2%
associate-*l*15.2%
Simplified15.2%
add-sqr-sqrt10.3%
sqrt-unprod40.3%
swap-sqr40.3%
add-sqr-sqrt40.3%
*-commutative40.3%
*-commutative40.3%
*-commutative40.3%
*-commutative40.3%
swap-sqr50.6%
add-sqr-sqrt50.6%
pow250.6%
Applied egg-rr50.6%
*-commutative50.6%
*-commutative50.6%
associate-*l*50.6%
*-commutative50.6%
*-commutative50.6%
Simplified50.6%
Taylor expanded in x around 0 43.8%
*-commutative43.8%
associate-*l*43.8%
unpow243.8%
*-commutative43.8%
rem-log-exp43.3%
log-pow43.3%
unpow243.3%
prod-exp43.3%
rem-log-exp43.8%
Simplified43.8%
if 1.69999999999999987e154 < (*.f64 t t) Initial program 100.0%
associate-*r*100.0%
exp-sqrt100.0%
*-commutative100.0%
flip--86.8%
associate-*r/86.8%
pow-exp86.8%
sqrt-unprod86.8%
swap-sqr86.8%
metadata-eval86.8%
fma-def86.8%
Applied egg-rr86.8%
associate-/l*86.8%
*-commutative86.8%
exp-prod86.8%
Simplified86.8%
Taylor expanded in x around inf 74.7%
Taylor expanded in t around 0 61.1%
unpow261.1%
Simplified61.1%
Final simplification78.1%
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (+ 1.0 (* 0.5 (* t t)))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
}
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))) * (1.0d0 + (0.5d0 * (t * t)))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t)))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))) * Float64(1.0 + Float64(0.5 * Float64(t * t)))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((2.0 * z))) * (1.0 + (0.5 * (t * t))); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\right) \cdot \left(1 + 0.5 \cdot \left(t \cdot t\right)\right)
\end{array}
Initial program 99.4%
Taylor expanded in t around 0 84.6%
unpow284.6%
Simplified84.6%
Final simplification84.6%
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* 2.0 z) (+ 1.0 (* t t))))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((2.0 * z) * (1.0 + (t * t))));
}
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) * (1.0d0 + (t * t))))
end function
public static double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * Math.sqrt(((2.0 * z) * (1.0 + (t * t))));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((2.0 * z) * (1.0 + (t * t))))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) * Float64(1.0 + Float64(t * t))))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) * (1.0 + (t * t)))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * z), $MachinePrecision] * N[(1.0 + N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(2 \cdot z\right) \cdot \left(1 + t \cdot t\right)}
\end{array}
Initial program 99.4%
associate-*l*99.8%
exp-sqrt99.8%
Simplified99.8%
pow-exp99.8%
sqrt-unprod99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 84.5%
+-commutative84.5%
unpow284.5%
Simplified84.5%
Final simplification84.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z z))))
(if (<= y -1.22e+82)
(sqrt (* (* y y) (+ z z)))
(if (<= y 3.55e+30) (* x (* 0.5 t_1)) (* y (- t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + z));
double tmp;
if (y <= -1.22e+82) {
tmp = sqrt(((y * y) * (z + z)));
} else if (y <= 3.55e+30) {
tmp = x * (0.5 * t_1);
} else {
tmp = y * -t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((z + z))
if (y <= (-1.22d+82)) then
tmp = sqrt(((y * y) * (z + z)))
else if (y <= 3.55d+30) then
tmp = x * (0.5d0 * t_1)
else
tmp = y * -t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + z));
double tmp;
if (y <= -1.22e+82) {
tmp = Math.sqrt(((y * y) * (z + z)));
} else if (y <= 3.55e+30) {
tmp = x * (0.5 * t_1);
} else {
tmp = y * -t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z + z)) tmp = 0 if y <= -1.22e+82: tmp = math.sqrt(((y * y) * (z + z))) elif y <= 3.55e+30: tmp = x * (0.5 * t_1) else: tmp = y * -t_1 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z + z)) tmp = 0.0 if (y <= -1.22e+82) tmp = sqrt(Float64(Float64(y * y) * Float64(z + z))); elseif (y <= 3.55e+30) tmp = Float64(x * Float64(0.5 * t_1)); else tmp = Float64(y * Float64(-t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z + z)); tmp = 0.0; if (y <= -1.22e+82) tmp = sqrt(((y * y) * (z + z))); elseif (y <= 3.55e+30) tmp = x * (0.5 * t_1); else tmp = y * -t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -1.22e+82], N[Sqrt[N[(N[(y * y), $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 3.55e+30], N[(x * N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision], N[(y * (-t$95$1)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z + z}\\
\mathbf{if}\;y \leq -1.22 \cdot 10^{+82}:\\
\;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\
\mathbf{elif}\;y \leq 3.55 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \left(0.5 \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-t_1\right)\\
\end{array}
\end{array}
if y < -1.22000000000000008e82Initial program 99.9%
Taylor expanded in t around 0 65.0%
associate-*l*65.0%
Simplified65.0%
add-sqr-sqrt60.5%
sqrt-unprod66.5%
swap-sqr66.4%
add-sqr-sqrt66.5%
*-commutative66.5%
*-commutative66.5%
*-commutative66.5%
*-commutative66.5%
swap-sqr64.4%
add-sqr-sqrt64.5%
pow264.5%
Applied egg-rr64.5%
*-commutative64.5%
*-commutative64.5%
associate-*l*64.5%
*-commutative64.5%
*-commutative64.5%
Simplified64.5%
Taylor expanded in x around 0 62.5%
*-commutative62.5%
associate-*l*62.5%
unpow262.5%
*-commutative62.5%
rem-log-exp42.5%
log-pow42.5%
unpow242.5%
prod-exp42.6%
rem-log-exp62.5%
Simplified62.5%
if -1.22000000000000008e82 < y < 3.54999999999999992e30Initial program 99.1%
Taylor expanded in t around 0 58.4%
associate-*l*58.3%
Simplified58.3%
Taylor expanded in x around inf 47.5%
expm1-log1p-u31.4%
expm1-udef19.9%
*-commutative19.9%
associate-*l*19.9%
sqrt-prod19.9%
Applied egg-rr19.9%
expm1-def31.4%
expm1-log1p47.5%
*-commutative47.5%
associate-*l*47.5%
*-commutative47.5%
rem-log-exp29.2%
log-pow29.2%
unpow229.2%
prod-exp29.2%
rem-log-exp47.5%
Simplified47.5%
if 3.54999999999999992e30 < y Initial program 99.8%
Taylor expanded in t around 0 62.0%
associate-*l*62.1%
Simplified62.1%
Taylor expanded in x around 0 44.6%
mul-1-neg44.6%
distribute-lft-neg-out44.6%
*-commutative44.6%
Simplified44.6%
expm1-log1p-u2.1%
expm1-udef1.7%
associate-*r*1.7%
pow1/21.7%
pow1/21.7%
pow-prod-down1.7%
count-21.7%
pow1/21.7%
Applied egg-rr1.7%
expm1-def2.1%
expm1-log1p44.6%
Simplified44.6%
Final simplification49.6%
(FPCore (x y z t) :precision binary64 (if (<= t 350000.0) (* (- (* x 0.5) y) (sqrt (* 2.0 z))) (if (<= t 6e+60) (sqrt (* (* y y) (+ z z))) (sqrt (* (* 0.5 z) (* x x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 350000.0) {
tmp = ((x * 0.5) - y) * sqrt((2.0 * z));
} else if (t <= 6e+60) {
tmp = sqrt(((y * y) * (z + z)));
} else {
tmp = sqrt(((0.5 * z) * (x * x)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 350000.0d0) then
tmp = ((x * 0.5d0) - y) * sqrt((2.0d0 * z))
else if (t <= 6d+60) then
tmp = sqrt(((y * y) * (z + z)))
else
tmp = sqrt(((0.5d0 * z) * (x * x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 350000.0) {
tmp = ((x * 0.5) - y) * Math.sqrt((2.0 * z));
} else if (t <= 6e+60) {
tmp = Math.sqrt(((y * y) * (z + z)));
} else {
tmp = Math.sqrt(((0.5 * z) * (x * x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 350000.0: tmp = ((x * 0.5) - y) * math.sqrt((2.0 * z)) elif t <= 6e+60: tmp = math.sqrt(((y * y) * (z + z))) else: tmp = math.sqrt(((0.5 * z) * (x * x))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 350000.0) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(2.0 * z))); elseif (t <= 6e+60) tmp = sqrt(Float64(Float64(y * y) * Float64(z + z))); else tmp = sqrt(Float64(Float64(0.5 * z) * Float64(x * x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 350000.0) tmp = ((x * 0.5) - y) * sqrt((2.0 * z)); elseif (t <= 6e+60) tmp = sqrt(((y * y) * (z + z))); else tmp = sqrt(((0.5 * z) * (x * x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 350000.0], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(2.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e+60], N[Sqrt[N[(N[(y * y), $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(0.5 * z), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 350000:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+60}:\\
\;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(0.5 \cdot z\right) \cdot \left(x \cdot x\right)}\\
\end{array}
\end{array}
if t < 3.5e5Initial program 99.7%
Taylor expanded in t around 0 69.2%
associate-*l*69.2%
Simplified69.2%
expm1-log1p-u43.4%
expm1-udef27.2%
*-commutative27.2%
*-commutative27.2%
associate-*r*27.2%
sqrt-prod27.2%
*-commutative27.2%
Applied egg-rr27.2%
expm1-def43.5%
expm1-log1p69.3%
*-commutative69.3%
*-commutative69.3%
*-commutative69.3%
Simplified69.3%
if 3.5e5 < t < 5.9999999999999997e60Initial program 88.9%
Taylor expanded in t around 0 15.8%
associate-*l*15.8%
Simplified15.8%
add-sqr-sqrt15.5%
sqrt-unprod67.3%
swap-sqr67.3%
add-sqr-sqrt67.3%
*-commutative67.3%
*-commutative67.3%
*-commutative67.3%
*-commutative67.3%
swap-sqr67.3%
add-sqr-sqrt67.3%
pow267.3%
Applied egg-rr67.3%
*-commutative67.3%
*-commutative67.3%
associate-*l*67.3%
*-commutative67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in x around 0 56.6%
*-commutative56.6%
associate-*l*56.6%
unpow256.6%
*-commutative56.6%
rem-log-exp67.0%
log-pow67.0%
unpow267.0%
prod-exp67.0%
rem-log-exp56.6%
Simplified56.6%
if 5.9999999999999997e60 < t Initial program 100.0%
Taylor expanded in t around 0 30.8%
associate-*l*30.8%
Simplified30.8%
add-sqr-sqrt18.5%
sqrt-unprod28.7%
swap-sqr28.7%
add-sqr-sqrt28.7%
*-commutative28.7%
*-commutative28.7%
*-commutative28.7%
*-commutative28.7%
swap-sqr32.7%
add-sqr-sqrt32.7%
pow232.7%
Applied egg-rr32.7%
*-commutative32.7%
*-commutative32.7%
associate-*l*32.7%
*-commutative32.7%
*-commutative32.7%
Simplified32.7%
Taylor expanded in x around inf 28.6%
associate-*r*28.6%
*-commutative28.6%
unpow228.6%
Simplified28.6%
Final simplification61.4%
(FPCore (x y z t) :precision binary64 (if (<= t 950.0) (* y (- (sqrt (+ z z)))) (sqrt (* y (* 2.0 (* y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 950.0) {
tmp = y * -sqrt((z + z));
} else {
tmp = sqrt((y * (2.0 * (y * z))));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 950.0d0) then
tmp = y * -sqrt((z + z))
else
tmp = sqrt((y * (2.0d0 * (y * z))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 950.0) {
tmp = y * -Math.sqrt((z + z));
} else {
tmp = Math.sqrt((y * (2.0 * (y * z))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 950.0: tmp = y * -math.sqrt((z + z)) else: tmp = math.sqrt((y * (2.0 * (y * z)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 950.0) tmp = Float64(y * Float64(-sqrt(Float64(z + z)))); else tmp = sqrt(Float64(y * Float64(2.0 * Float64(y * z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 950.0) tmp = y * -sqrt((z + z)); else tmp = sqrt((y * (2.0 * (y * z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 950.0], N[(y * (-N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[Sqrt[N[(y * N[(2.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 950:\\
\;\;\;\;y \cdot \left(-\sqrt{z + z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{y \cdot \left(2 \cdot \left(y \cdot z\right)\right)}\\
\end{array}
\end{array}
if t < 950Initial program 99.7%
Taylor expanded in t around 0 69.2%
associate-*l*69.2%
Simplified69.2%
Taylor expanded in x around 0 30.0%
mul-1-neg30.0%
distribute-lft-neg-out30.0%
*-commutative30.0%
Simplified30.0%
expm1-log1p-u19.4%
expm1-udef12.3%
associate-*r*12.3%
pow1/212.3%
pow1/212.3%
pow-prod-down12.3%
count-212.3%
pow1/212.3%
Applied egg-rr12.3%
expm1-def19.4%
expm1-log1p30.1%
Simplified30.1%
if 950 < t Initial program 98.2%
Taylor expanded in t around 0 28.4%
associate-*l*28.4%
Simplified28.4%
add-sqr-sqrt18.0%
sqrt-unprod34.9%
swap-sqr34.9%
add-sqr-sqrt34.9%
*-commutative34.9%
*-commutative34.9%
*-commutative34.9%
*-commutative34.9%
swap-sqr38.3%
add-sqr-sqrt38.3%
pow238.3%
Applied egg-rr38.3%
*-commutative38.3%
*-commutative38.3%
associate-*l*38.3%
*-commutative38.3%
*-commutative38.3%
Simplified38.3%
Taylor expanded in x around 0 20.9%
*-commutative20.9%
associate-*l*20.9%
unpow220.9%
*-commutative20.9%
rem-log-exp31.0%
log-pow31.0%
unpow231.0%
prod-exp31.0%
rem-log-exp20.9%
Simplified20.9%
Taylor expanded in y around 0 20.9%
unpow220.9%
count-220.9%
distribute-lft-out20.9%
associate-*r*20.9%
distribute-lft-in20.9%
count-220.9%
Simplified20.9%
Final simplification28.1%
(FPCore (x y z t) :precision binary64 (if (<= t 900.0) (* y (- (sqrt (+ z z)))) (sqrt (* (* y y) (+ z z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 900.0) {
tmp = y * -sqrt((z + z));
} else {
tmp = sqrt(((y * y) * (z + z)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 900.0d0) then
tmp = y * -sqrt((z + z))
else
tmp = sqrt(((y * y) * (z + z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 900.0) {
tmp = y * -Math.sqrt((z + z));
} else {
tmp = Math.sqrt(((y * y) * (z + z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 900.0: tmp = y * -math.sqrt((z + z)) else: tmp = math.sqrt(((y * y) * (z + z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 900.0) tmp = Float64(y * Float64(-sqrt(Float64(z + z)))); else tmp = sqrt(Float64(Float64(y * y) * Float64(z + z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 900.0) tmp = y * -sqrt((z + z)); else tmp = sqrt(((y * y) * (z + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 900.0], N[(y * (-N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[Sqrt[N[(N[(y * y), $MachinePrecision] * N[(z + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 900:\\
\;\;\;\;y \cdot \left(-\sqrt{z + z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(y \cdot y\right) \cdot \left(z + z\right)}\\
\end{array}
\end{array}
if t < 900Initial program 99.7%
Taylor expanded in t around 0 69.2%
associate-*l*69.2%
Simplified69.2%
Taylor expanded in x around 0 30.0%
mul-1-neg30.0%
distribute-lft-neg-out30.0%
*-commutative30.0%
Simplified30.0%
expm1-log1p-u19.4%
expm1-udef12.3%
associate-*r*12.3%
pow1/212.3%
pow1/212.3%
pow-prod-down12.3%
count-212.3%
pow1/212.3%
Applied egg-rr12.3%
expm1-def19.4%
expm1-log1p30.1%
Simplified30.1%
if 900 < t Initial program 98.2%
Taylor expanded in t around 0 28.4%
associate-*l*28.4%
Simplified28.4%
add-sqr-sqrt18.0%
sqrt-unprod34.9%
swap-sqr34.9%
add-sqr-sqrt34.9%
*-commutative34.9%
*-commutative34.9%
*-commutative34.9%
*-commutative34.9%
swap-sqr38.3%
add-sqr-sqrt38.3%
pow238.3%
Applied egg-rr38.3%
*-commutative38.3%
*-commutative38.3%
associate-*l*38.3%
*-commutative38.3%
*-commutative38.3%
Simplified38.3%
Taylor expanded in x around 0 20.9%
*-commutative20.9%
associate-*l*20.9%
unpow220.9%
*-commutative20.9%
rem-log-exp31.0%
log-pow31.0%
unpow231.0%
prod-exp31.0%
rem-log-exp20.9%
Simplified20.9%
Final simplification28.1%
(FPCore (x y z t) :precision binary64 (if (<= x 2.4e+27) (* y (- (sqrt (+ z z)))) (sqrt (* (* 0.5 z) (* x x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.4e+27) {
tmp = y * -sqrt((z + z));
} else {
tmp = sqrt(((0.5 * z) * (x * x)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 2.4d+27) then
tmp = y * -sqrt((z + z))
else
tmp = sqrt(((0.5d0 * z) * (x * x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.4e+27) {
tmp = y * -Math.sqrt((z + z));
} else {
tmp = Math.sqrt(((0.5 * z) * (x * x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 2.4e+27: tmp = y * -math.sqrt((z + z)) else: tmp = math.sqrt(((0.5 * z) * (x * x))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 2.4e+27) tmp = Float64(y * Float64(-sqrt(Float64(z + z)))); else tmp = sqrt(Float64(Float64(0.5 * z) * Float64(x * x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 2.4e+27) tmp = y * -sqrt((z + z)); else tmp = sqrt(((0.5 * z) * (x * x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 2.4e+27], N[(y * (-N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[Sqrt[N[(N[(0.5 * z), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{+27}:\\
\;\;\;\;y \cdot \left(-\sqrt{z + z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(0.5 \cdot z\right) \cdot \left(x \cdot x\right)}\\
\end{array}
\end{array}
if x < 2.39999999999999998e27Initial program 99.2%
Taylor expanded in t around 0 56.9%
associate-*l*56.8%
Simplified56.8%
Taylor expanded in x around 0 30.0%
mul-1-neg30.0%
distribute-lft-neg-out30.0%
*-commutative30.0%
Simplified30.0%
expm1-log1p-u20.5%
expm1-udef12.8%
associate-*r*12.8%
pow1/212.8%
pow1/212.8%
pow-prod-down12.8%
count-212.8%
pow1/212.8%
Applied egg-rr12.8%
expm1-def20.6%
expm1-log1p30.1%
Simplified30.1%
if 2.39999999999999998e27 < x Initial program 99.9%
Taylor expanded in t around 0 68.7%
associate-*l*68.8%
Simplified68.8%
add-sqr-sqrt59.0%
sqrt-unprod60.7%
swap-sqr60.6%
add-sqr-sqrt60.7%
*-commutative60.7%
*-commutative60.7%
*-commutative60.7%
*-commutative60.7%
swap-sqr60.7%
add-sqr-sqrt60.7%
pow260.7%
Applied egg-rr60.7%
*-commutative60.7%
*-commutative60.7%
associate-*l*60.7%
*-commutative60.7%
*-commutative60.7%
Simplified60.7%
Taylor expanded in x around inf 59.4%
associate-*r*59.4%
*-commutative59.4%
unpow259.4%
Simplified59.4%
Final simplification38.5%
(FPCore (x y z t) :precision binary64 (* y (- (sqrt (+ z z)))))
double code(double x, double y, double z, double t) {
return y * -sqrt((z + z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * -sqrt((z + z))
end function
public static double code(double x, double y, double z, double t) {
return y * -Math.sqrt((z + z));
}
def code(x, y, z, t): return y * -math.sqrt((z + z))
function code(x, y, z, t) return Float64(y * Float64(-sqrt(Float64(z + z)))) end
function tmp = code(x, y, z, t) tmp = y * -sqrt((z + z)); end
code[x_, y_, z_, t_] := N[(y * (-N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-\sqrt{z + z}\right)
\end{array}
Initial program 99.4%
Taylor expanded in t around 0 60.3%
associate-*l*60.2%
Simplified60.2%
Taylor expanded in x around 0 26.0%
mul-1-neg26.0%
distribute-lft-neg-out26.0%
*-commutative26.0%
Simplified26.0%
expm1-log1p-u16.8%
expm1-udef11.2%
associate-*r*11.2%
pow1/211.2%
pow1/211.2%
pow-prod-down11.2%
count-211.2%
pow1/211.2%
Applied egg-rr11.2%
expm1-def16.8%
expm1-log1p26.1%
Simplified26.1%
Final simplification26.1%
(FPCore (x y z t) :precision binary64 (* y (sqrt (+ z z))))
double code(double x, double y, double z, double t) {
return y * sqrt((z + z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * sqrt((z + z))
end function
public static double code(double x, double y, double z, double t) {
return y * Math.sqrt((z + z));
}
def code(x, y, z, t): return y * math.sqrt((z + z))
function code(x, y, z, t) return Float64(y * sqrt(Float64(z + z))) end
function tmp = code(x, y, z, t) tmp = y * sqrt((z + z)); end
code[x_, y_, z_, t_] := N[(y * N[Sqrt[N[(z + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \sqrt{z + z}
\end{array}
Initial program 99.4%
Taylor expanded in t around 0 60.3%
associate-*l*60.2%
Simplified60.2%
add-sqr-sqrt32.8%
sqrt-unprod32.5%
swap-sqr32.5%
add-sqr-sqrt32.5%
*-commutative32.5%
*-commutative32.5%
*-commutative32.5%
*-commutative32.5%
swap-sqr32.6%
add-sqr-sqrt32.6%
pow232.6%
Applied egg-rr32.6%
*-commutative32.6%
*-commutative32.6%
associate-*l*32.6%
*-commutative32.6%
*-commutative32.6%
Simplified32.6%
Taylor expanded in x around 0 17.8%
*-commutative17.8%
associate-*l*17.8%
unpow217.8%
*-commutative17.8%
rem-log-exp16.1%
log-pow16.1%
unpow216.1%
prod-exp16.2%
rem-log-exp17.8%
Simplified17.8%
pow1/217.8%
*-commutative17.8%
unpow-prod-down16.8%
pow1/216.8%
pow1/216.8%
Applied egg-rr16.8%
*-commutative16.8%
rem-sqrt-square15.7%
unpow115.7%
sqr-pow1.3%
fabs-sqr1.3%
sqr-pow2.4%
unpow12.4%
Simplified2.4%
Final simplification2.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 2023230
(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))))