
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))
double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * 0.5d0) - y) * sqrt((z * 2.0d0))) * exp(((t * t) / 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (((x * 0.5) - y) * Math.sqrt((z * 2.0))) * Math.exp(((t * t) / 2.0));
}
def code(x, y, z, t): return (((x * 0.5) - y) * math.sqrt((z * 2.0))) * math.exp(((t * t) / 2.0))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))) * exp(Float64(Float64(t * t) / 2.0))) end
function tmp = code(x, y, z, t) tmp = (((x * 0.5) - y) * sqrt((z * 2.0))) * exp(((t * t) / 2.0)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(t * t), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right) \cdot e^{\frac{t \cdot t}{2}}
\end{array}
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* (* z 2.0) (pow (exp t) t)))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((z * 2.0) * 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(((z * 2.0d0) * (exp(t) ** t)))
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(t), t)));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((z * 2.0) * math.pow(math.exp(t), t)))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(z * 2.0) * (exp(t) ^ t)))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((z * 2.0) * (exp(t) ^ t))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(z * 2.0), $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(z \cdot 2\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 (* (- (* x 0.5) y) (sqrt (* (* z 2.0) (exp (* t t))))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((z * 2.0) * 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(((z * 2.0d0) * exp((t * t))))
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))));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((z * 2.0) * math.exp((t * t))))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(z * 2.0) * exp(Float64(t * t))))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((z * 2.0) * exp((t * t)))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(N[(z * 2.0), $MachinePrecision] * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{\left(z \cdot 2\right) \cdot e^{t \cdot 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%
pow-exp99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (or (<= t -1.0) (not (<= t 1.0)))
(* t_1 (sqrt (* 2.0 (* t (* z t)))))
(* t_1 (sqrt (* z 2.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if ((t <= -1.0) || !(t <= 1.0)) {
tmp = t_1 * sqrt((2.0 * (t * (z * t))));
} else {
tmp = t_1 * sqrt((z * 2.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 0.5d0) - y
if ((t <= (-1.0d0)) .or. (.not. (t <= 1.0d0))) then
tmp = t_1 * sqrt((2.0d0 * (t * (z * t))))
else
tmp = t_1 * sqrt((z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if ((t <= -1.0) || !(t <= 1.0)) {
tmp = t_1 * Math.sqrt((2.0 * (t * (z * t))));
} else {
tmp = t_1 * Math.sqrt((z * 2.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if (t <= -1.0) or not (t <= 1.0): tmp = t_1 * math.sqrt((2.0 * (t * (z * t)))) else: tmp = t_1 * math.sqrt((z * 2.0)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if ((t <= -1.0) || !(t <= 1.0)) tmp = Float64(t_1 * sqrt(Float64(2.0 * Float64(t * Float64(z * t))))); else tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if ((t <= -1.0) || ~((t <= 1.0))) tmp = t_1 * sqrt((2.0 * (t * (z * t)))); else tmp = t_1 * sqrt((z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision]}, If[Or[LessEqual[t, -1.0], N[Not[LessEqual[t, 1.0]], $MachinePrecision]], N[(t$95$1 * N[Sqrt[N[(2.0 * N[(t * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \leq -1 \lor \neg \left(t \leq 1\right):\\
\;\;\;\;t_1 \cdot \sqrt{2 \cdot \left(t \cdot \left(z \cdot t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sqrt{z \cdot 2}\\
\end{array}
\end{array}
if t < -1 or 1 < t Initial program 99.2%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
pow-exp100.0%
sqrt-unprod100.0%
Applied egg-rr100.0%
pow-exp99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 69.0%
unpow269.0%
Simplified69.0%
Taylor expanded in t around inf 69.0%
unpow269.0%
associate-*l*62.6%
Simplified62.6%
if -1 < t < 1Initial program 99.6%
associate-*l*99.6%
exp-sqrt99.6%
Simplified99.6%
pow-exp99.6%
sqrt-unprod99.6%
Applied egg-rr99.6%
Taylor expanded in t around 0 98.8%
Final simplification79.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x 0.5) y)))
(if (<= (* t t) 2e-9)
(* t_1 (sqrt (* z 2.0)))
(* t_1 (sqrt (* (* z 2.0) (* t t)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if ((t * t) <= 2e-9) {
tmp = t_1 * sqrt((z * 2.0));
} else {
tmp = t_1 * sqrt(((z * 2.0) * (t * t)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 0.5d0) - y
if ((t * t) <= 2d-9) then
tmp = t_1 * sqrt((z * 2.0d0))
else
tmp = t_1 * sqrt(((z * 2.0d0) * (t * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) - y;
double tmp;
if ((t * t) <= 2e-9) {
tmp = t_1 * Math.sqrt((z * 2.0));
} else {
tmp = t_1 * Math.sqrt(((z * 2.0) * (t * t)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) - y tmp = 0 if (t * t) <= 2e-9: tmp = t_1 * math.sqrt((z * 2.0)) else: tmp = t_1 * math.sqrt(((z * 2.0) * (t * t))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) - y) tmp = 0.0 if (Float64(t * t) <= 2e-9) tmp = Float64(t_1 * sqrt(Float64(z * 2.0))); else tmp = Float64(t_1 * sqrt(Float64(Float64(z * 2.0) * Float64(t * t)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) - y; tmp = 0.0; if ((t * t) <= 2e-9) tmp = t_1 * sqrt((z * 2.0)); else tmp = t_1 * sqrt(((z * 2.0) * (t * t))); 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[(t * t), $MachinePrecision], 2e-9], 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[(t * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot 0.5 - y\\
\mathbf{if}\;t \cdot t \leq 2 \cdot 10^{-9}:\\
\;\;\;\;t_1 \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sqrt{\left(z \cdot 2\right) \cdot \left(t \cdot t\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 2.00000000000000012e-9Initial program 99.6%
associate-*l*99.6%
exp-sqrt99.6%
Simplified99.6%
pow-exp99.6%
sqrt-unprod99.6%
Applied egg-rr99.6%
Taylor expanded in t around 0 98.8%
if 2.00000000000000012e-9 < (*.f64 t t) Initial program 99.2%
associate-*l*99.9%
exp-sqrt99.9%
Simplified99.9%
pow-exp100.0%
sqrt-unprod100.0%
Applied egg-rr100.0%
pow-exp99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 69.0%
unpow269.0%
Simplified69.0%
Taylor expanded in t around inf 69.0%
unpow269.0%
Simplified69.0%
Final simplification83.2%
(FPCore (x y z t) :precision binary64 (* (+ 1.0 (* 0.5 (* t t))) (* (- (* x 0.5) y) (sqrt (* z 2.0)))))
double code(double x, double y, double z, double t) {
return (1.0 + (0.5 * (t * t))) * (((x * 0.5) - y) * sqrt((z * 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 = (1.0d0 + (0.5d0 * (t * t))) * (((x * 0.5d0) - y) * sqrt((z * 2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (1.0 + (0.5 * (t * t))) * (((x * 0.5) - y) * Math.sqrt((z * 2.0)));
}
def code(x, y, z, t): return (1.0 + (0.5 * (t * t))) * (((x * 0.5) - y) * math.sqrt((z * 2.0)))
function code(x, y, z, t) return Float64(Float64(1.0 + Float64(0.5 * Float64(t * t))) * Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0)))) end
function tmp = code(x, y, z, t) tmp = (1.0 + (0.5 * (t * t))) * (((x * 0.5) - y) * sqrt((z * 2.0))); end
code[x_, y_, z_, t_] := N[(N[(1.0 + N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + 0.5 \cdot \left(t \cdot t\right)\right) \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\right)
\end{array}
Initial program 99.4%
Taylor expanded in t around 0 85.8%
unpow285.8%
Simplified85.8%
Final simplification85.8%
(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(2.0 * Float64(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[(2.0 * N[(z * N[(N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot \left(z \cdot \left(t \cdot t + 1\right)\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 83.6%
distribute-lft-out83.6%
distribute-rgt1-in83.6%
unpow283.6%
Simplified83.6%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (<= t 7e+193) (* (- (* x 0.5) y) (sqrt (* z 2.0))) (* 0.5 (sqrt (* 2.0 (* z (* x x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 7e+193) {
tmp = ((x * 0.5) - y) * sqrt((z * 2.0));
} else {
tmp = 0.5 * sqrt((2.0 * (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 <= 7d+193) then
tmp = ((x * 0.5d0) - y) * sqrt((z * 2.0d0))
else
tmp = 0.5d0 * sqrt((2.0d0 * (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 <= 7e+193) {
tmp = ((x * 0.5) - y) * Math.sqrt((z * 2.0));
} else {
tmp = 0.5 * Math.sqrt((2.0 * (z * (x * x))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 7e+193: tmp = ((x * 0.5) - y) * math.sqrt((z * 2.0)) else: tmp = 0.5 * math.sqrt((2.0 * (z * (x * x)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 7e+193) tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * 2.0))); else tmp = Float64(0.5 * sqrt(Float64(2.0 * Float64(z * Float64(x * x))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 7e+193) tmp = ((x * 0.5) - y) * sqrt((z * 2.0)); else tmp = 0.5 * sqrt((2.0 * (z * (x * x)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 7e+193], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(2.0 * N[(z * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7 \cdot 10^{+193}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{2 \cdot \left(z \cdot \left(x \cdot x\right)\right)}\\
\end{array}
\end{array}
if t < 7.00000000000000026e193Initial program 99.3%
associate-*l*99.8%
exp-sqrt99.7%
Simplified99.7%
pow-exp99.8%
sqrt-unprod99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 60.7%
if 7.00000000000000026e193 < t Initial program 100.0%
Taylor expanded in t around 0 15.4%
Taylor expanded in x around inf 10.0%
associate-*l*10.0%
Simplified10.0%
add-cube-cbrt10.0%
pow310.0%
Applied egg-rr10.0%
rem-cube-cbrt10.0%
add-sqr-sqrt9.1%
sqrt-unprod30.8%
swap-sqr30.8%
add-sqr-sqrt30.8%
*-commutative30.8%
*-commutative30.8%
swap-sqr30.8%
add-sqr-sqrt30.8%
Applied egg-rr30.8%
Final simplification57.5%
(FPCore (x y z t) :precision binary64 (* 0.5 (sqrt (* 2.0 (* z (* x x))))))
double code(double x, double y, double z, double t) {
return 0.5 * sqrt((2.0 * (z * (x * x))));
}
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 = 0.5d0 * sqrt((2.0d0 * (z * (x * x))))
end function
public static double code(double x, double y, double z, double t) {
return 0.5 * Math.sqrt((2.0 * (z * (x * x))));
}
def code(x, y, z, t): return 0.5 * math.sqrt((2.0 * (z * (x * x))))
function code(x, y, z, t) return Float64(0.5 * sqrt(Float64(2.0 * Float64(z * Float64(x * x))))) end
function tmp = code(x, y, z, t) tmp = 0.5 * sqrt((2.0 * (z * (x * x)))); end
code[x_, y_, z_, t_] := N[(0.5 * N[Sqrt[N[(2.0 * N[(z * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \sqrt{2 \cdot \left(z \cdot \left(x \cdot x\right)\right)}
\end{array}
Initial program 99.4%
Taylor expanded in t around 0 55.8%
Taylor expanded in x around inf 28.6%
associate-*l*28.6%
Simplified28.6%
add-cube-cbrt28.4%
pow328.4%
Applied egg-rr28.4%
rem-cube-cbrt28.6%
add-sqr-sqrt16.5%
sqrt-unprod19.8%
swap-sqr19.8%
add-sqr-sqrt19.8%
*-commutative19.8%
*-commutative19.8%
swap-sqr19.8%
add-sqr-sqrt19.8%
Applied egg-rr19.8%
Final simplification19.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 2023195
(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))))