
(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 14 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 (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(z * Float64(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[(z * N[(2.0 * N[Exp[N[(t * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot e^{t \cdot t}\right)}
\end{array}
Initial program 99.5%
Simplified0
Applied egg-rr0
(FPCore (x y z t)
:precision binary64
(*
(sqrt (* z 2.0))
(*
(- (* x 0.5) y)
(+
1.0
(*
(* t t)
(+ 0.5 (* (* t t) (+ 0.125 (* t (* t 0.020833333333333332))))))))))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * (((x * 0.5) - y) * (1.0 + ((t * t) * (0.5 + ((t * t) * (0.125 + (t * (t * 0.020833333333333332))))))));
}
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((z * 2.0d0)) * (((x * 0.5d0) - y) * (1.0d0 + ((t * t) * (0.5d0 + ((t * t) * (0.125d0 + (t * (t * 0.020833333333333332d0))))))))
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * (((x * 0.5) - y) * (1.0 + ((t * t) * (0.5 + ((t * t) * (0.125 + (t * (t * 0.020833333333333332))))))));
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * (((x * 0.5) - y) * (1.0 + ((t * t) * (0.5 + ((t * t) * (0.125 + (t * (t * 0.020833333333333332))))))))
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(Float64(x * 0.5) - y) * Float64(1.0 + Float64(Float64(t * t) * Float64(0.5 + Float64(Float64(t * t) * Float64(0.125 + Float64(t * Float64(t * 0.020833333333333332))))))))) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * (((x * 0.5) - y) * (1.0 + ((t * t) * (0.5 + ((t * t) * (0.125 + (t * (t * 0.020833333333333332)))))))); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(1.0 + N[(N[(t * t), $MachinePrecision] * N[(0.5 + N[(N[(t * t), $MachinePrecision] * N[(0.125 + N[(t * N[(t * 0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(1 + \left(t \cdot t\right) \cdot \left(0.5 + \left(t \cdot t\right) \cdot \left(0.125 + t \cdot \left(t \cdot 0.020833333333333332\right)\right)\right)\right)\right)
\end{array}
Initial program 99.5%
Simplified0
Taylor expanded in t around 0 0
Simplified0
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (* z 2.0))))
(if (<= (* t t) 5e-8)
(* t_1 (- (* 0.5 x) y))
(if (<= (* t t) 1e+271)
(* (- (* x 0.5) y) (* t_1 t))
(* (* 0.5 x) (sqrt (* z (* 2.0 (* t t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if ((t * t) <= 5e-8) {
tmp = t_1 * ((0.5 * x) - y);
} else if ((t * t) <= 1e+271) {
tmp = ((x * 0.5) - y) * (t_1 * t);
} else {
tmp = (0.5 * x) * 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 = sqrt((z * 2.0d0))
if ((t * t) <= 5d-8) then
tmp = t_1 * ((0.5d0 * x) - y)
else if ((t * t) <= 1d+271) then
tmp = ((x * 0.5d0) - y) * (t_1 * t)
else
tmp = (0.5d0 * x) * 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 = Math.sqrt((z * 2.0));
double tmp;
if ((t * t) <= 5e-8) {
tmp = t_1 * ((0.5 * x) - y);
} else if ((t * t) <= 1e+271) {
tmp = ((x * 0.5) - y) * (t_1 * t);
} else {
tmp = (0.5 * x) * Math.sqrt((z * (2.0 * (t * t))));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if (t * t) <= 5e-8: tmp = t_1 * ((0.5 * x) - y) elif (t * t) <= 1e+271: tmp = ((x * 0.5) - y) * (t_1 * t) else: tmp = (0.5 * x) * math.sqrt((z * (2.0 * (t * t)))) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (Float64(t * t) <= 5e-8) tmp = Float64(t_1 * Float64(Float64(0.5 * x) - y)); elseif (Float64(t * t) <= 1e+271) tmp = Float64(Float64(Float64(x * 0.5) - y) * Float64(t_1 * t)); else tmp = Float64(Float64(0.5 * x) * sqrt(Float64(z * Float64(2.0 * Float64(t * t))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if ((t * t) <= 5e-8) tmp = t_1 * ((0.5 * x) - y); elseif ((t * t) <= 1e+271) tmp = ((x * 0.5) - y) * (t_1 * t); else tmp = (0.5 * x) * sqrt((z * (2.0 * (t * t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t * t), $MachinePrecision], 5e-8], N[(t$95$1 * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * t), $MachinePrecision], 1e+271], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * x), $MachinePrecision] * N[Sqrt[N[(z * N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \cdot t \leq 5 \cdot 10^{-8}:\\
\;\;\;\;t\_1 \cdot \left(0.5 \cdot x - y\right)\\
\mathbf{elif}\;t \cdot t \leq 10^{+271}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \left(t\_1 \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot x\right) \cdot \sqrt{z \cdot \left(2 \cdot \left(t \cdot t\right)\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 4.9999999999999998e-8Initial program 99.8%
Simplified0
Taylor expanded in t around 0 0
Simplified0
if 4.9999999999999998e-8 < (*.f64 t t) < 9.99999999999999953e270Initial program 98.4%
Simplified0
Applied egg-rr0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
if 9.99999999999999953e270 < (*.f64 t t) Initial program 100.0%
Simplified0
Applied egg-rr0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in t around inf 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (* (- (* x 0.5) y) (+ 1.0 (* (* t t) (+ 0.5 (* (* t t) 0.125)))))))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * (((x * 0.5) - y) * (1.0 + ((t * t) * (0.5 + ((t * t) * 0.125)))));
}
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((z * 2.0d0)) * (((x * 0.5d0) - y) * (1.0d0 + ((t * t) * (0.5d0 + ((t * t) * 0.125d0)))))
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * (((x * 0.5) - y) * (1.0 + ((t * t) * (0.5 + ((t * t) * 0.125)))));
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * (((x * 0.5) - y) * (1.0 + ((t * t) * (0.5 + ((t * t) * 0.125)))))
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(Float64(x * 0.5) - y) * Float64(1.0 + Float64(Float64(t * t) * Float64(0.5 + Float64(Float64(t * t) * 0.125)))))) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * (((x * 0.5) - y) * (1.0 + ((t * t) * (0.5 + ((t * t) * 0.125))))); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(1.0 + N[(N[(t * t), $MachinePrecision] * N[(0.5 + N[(N[(t * t), $MachinePrecision] * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(1 + \left(t \cdot t\right) \cdot \left(0.5 + \left(t \cdot t\right) \cdot 0.125\right)\right)\right)
\end{array}
Initial program 99.5%
Simplified0
Taylor expanded in t around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= (* t t) 5e-8) (* (sqrt (* z 2.0)) (- (* 0.5 x) y)) (* (* x (- 0.5 (/ y x))) (sqrt (* z (* 2.0 (* t t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 5e-8) {
tmp = sqrt((z * 2.0)) * ((0.5 * x) - y);
} else {
tmp = (x * (0.5 - (y / x))) * 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) :: tmp
if ((t * t) <= 5d-8) then
tmp = sqrt((z * 2.0d0)) * ((0.5d0 * x) - y)
else
tmp = (x * (0.5d0 - (y / x))) * 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 tmp;
if ((t * t) <= 5e-8) {
tmp = Math.sqrt((z * 2.0)) * ((0.5 * x) - y);
} else {
tmp = (x * (0.5 - (y / x))) * Math.sqrt((z * (2.0 * (t * t))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t * t) <= 5e-8: tmp = math.sqrt((z * 2.0)) * ((0.5 * x) - y) else: tmp = (x * (0.5 - (y / x))) * math.sqrt((z * (2.0 * (t * t)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(t * t) <= 5e-8) tmp = Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(0.5 * x) - y)); else tmp = Float64(Float64(x * Float64(0.5 - Float64(y / x))) * sqrt(Float64(z * Float64(2.0 * Float64(t * t))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t * t) <= 5e-8) tmp = sqrt((z * 2.0)) * ((0.5 * x) - y); else tmp = (x * (0.5 - (y / x))) * sqrt((z * (2.0 * (t * t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(t * t), $MachinePrecision], 5e-8], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(0.5 - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(z * N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left(0.5 \cdot x - y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(0.5 - \frac{y}{x}\right)\right) \cdot \sqrt{z \cdot \left(2 \cdot \left(t \cdot t\right)\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 4.9999999999999998e-8Initial program 99.8%
Simplified0
Taylor expanded in t around 0 0
Simplified0
if 4.9999999999999998e-8 < (*.f64 t t) Initial program 99.3%
Simplified0
Applied egg-rr0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in t around inf 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (+ (* 2.0 z) (* (* t t) (* z (+ 2.0 (* t t))))))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt(((2.0 * z) + ((t * t) * (z * (2.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) + ((t * t) * (z * (2.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) + ((t * t) * (z * (2.0 + (t * t))))));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt(((2.0 * z) + ((t * t) * (z * (2.0 + (t * t))))))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(Float64(2.0 * z) + Float64(Float64(t * t) * Float64(z * Float64(2.0 + Float64(t * t))))))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt(((2.0 * z) + ((t * t) * (z * (2.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[(N[(t * t), $MachinePrecision] * N[(z * N[(2.0 + N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{2 \cdot z + \left(t \cdot t\right) \cdot \left(z \cdot \left(2 + t \cdot t\right)\right)}
\end{array}
Initial program 99.5%
Simplified0
Applied egg-rr0
Taylor expanded in t around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= (* t t) 5e-8) (* (sqrt (* z 2.0)) (- (* 0.5 x) y)) (* (- (* x 0.5) y) (sqrt (* z (* 2.0 (* t t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 5e-8) {
tmp = sqrt((z * 2.0)) * ((0.5 * x) - y);
} else {
tmp = ((x * 0.5) - y) * 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) :: tmp
if ((t * t) <= 5d-8) then
tmp = sqrt((z * 2.0d0)) * ((0.5d0 * x) - y)
else
tmp = ((x * 0.5d0) - y) * 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 tmp;
if ((t * t) <= 5e-8) {
tmp = Math.sqrt((z * 2.0)) * ((0.5 * x) - y);
} else {
tmp = ((x * 0.5) - y) * Math.sqrt((z * (2.0 * (t * t))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t * t) <= 5e-8: tmp = math.sqrt((z * 2.0)) * ((0.5 * x) - y) else: tmp = ((x * 0.5) - y) * math.sqrt((z * (2.0 * (t * t)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(t * t) <= 5e-8) tmp = Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(0.5 * x) - y)); else tmp = Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * Float64(2.0 * Float64(t * t))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t * t) <= 5e-8) tmp = sqrt((z * 2.0)) * ((0.5 * x) - y); else tmp = ((x * 0.5) - y) * sqrt((z * (2.0 * (t * t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(t * t), $MachinePrecision], 5e-8], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left(0.5 \cdot x - y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot \left(t \cdot t\right)\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 4.9999999999999998e-8Initial program 99.8%
Simplified0
Taylor expanded in t around 0 0
Simplified0
if 4.9999999999999998e-8 < (*.f64 t t) Initial program 99.3%
Simplified0
Applied egg-rr0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in t around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= (* t t) 1.7e+89) (* (sqrt (* z 2.0)) (- (* 0.5 x) y)) (* (* 0.5 x) (sqrt (* z (* 2.0 (* t t)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 1.7e+89) {
tmp = sqrt((z * 2.0)) * ((0.5 * x) - y);
} else {
tmp = (0.5 * x) * 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) :: tmp
if ((t * t) <= 1.7d+89) then
tmp = sqrt((z * 2.0d0)) * ((0.5d0 * x) - y)
else
tmp = (0.5d0 * x) * 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 tmp;
if ((t * t) <= 1.7e+89) {
tmp = Math.sqrt((z * 2.0)) * ((0.5 * x) - y);
} else {
tmp = (0.5 * x) * Math.sqrt((z * (2.0 * (t * t))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t * t) <= 1.7e+89: tmp = math.sqrt((z * 2.0)) * ((0.5 * x) - y) else: tmp = (0.5 * x) * math.sqrt((z * (2.0 * (t * t)))) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(t * t) <= 1.7e+89) tmp = Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(0.5 * x) - y)); else tmp = Float64(Float64(0.5 * x) * sqrt(Float64(z * Float64(2.0 * Float64(t * t))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t * t) <= 1.7e+89) tmp = sqrt((z * 2.0)) * ((0.5 * x) - y); else tmp = (0.5 * x) * sqrt((z * (2.0 * (t * t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(t * t), $MachinePrecision], 1.7e+89], N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * x), $MachinePrecision] * N[Sqrt[N[(z * N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 1.7 \cdot 10^{+89}:\\
\;\;\;\;\sqrt{z \cdot 2} \cdot \left(0.5 \cdot x - y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot x\right) \cdot \sqrt{z \cdot \left(2 \cdot \left(t \cdot t\right)\right)}\\
\end{array}
\end{array}
if (*.f64 t t) < 1.7000000000000001e89Initial program 99.8%
Simplified0
Taylor expanded in t around 0 0
Simplified0
if 1.7000000000000001e89 < (*.f64 t t) Initial program 99.1%
Simplified0
Applied egg-rr0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in t around inf 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (sqrt (* z 2.0))) (t_2 (* t_1 (* 0.5 x)))) (if (<= x -3.6e-13) t_2 (if (<= x 6e+125) (* t_1 (- y)) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double t_2 = t_1 * (0.5 * x);
double tmp;
if (x <= -3.6e-13) {
tmp = t_2;
} else if (x <= 6e+125) {
tmp = t_1 * -y;
} else {
tmp = t_2;
}
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) :: tmp
t_1 = sqrt((z * 2.0d0))
t_2 = t_1 * (0.5d0 * x)
if (x <= (-3.6d-13)) then
tmp = t_2
else if (x <= 6d+125) then
tmp = t_1 * -y
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z * 2.0));
double t_2 = t_1 * (0.5 * x);
double tmp;
if (x <= -3.6e-13) {
tmp = t_2;
} else if (x <= 6e+125) {
tmp = t_1 * -y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) t_2 = t_1 * (0.5 * x) tmp = 0 if x <= -3.6e-13: tmp = t_2 elif x <= 6e+125: tmp = t_1 * -y else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) t_2 = Float64(t_1 * Float64(0.5 * x)) tmp = 0.0 if (x <= -3.6e-13) tmp = t_2; elseif (x <= 6e+125) tmp = Float64(t_1 * Float64(-y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); t_2 = t_1 * (0.5 * x); tmp = 0.0; if (x <= -3.6e-13) tmp = t_2; elseif (x <= 6e+125) tmp = t_1 * -y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(0.5 * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e-13], t$95$2, If[LessEqual[x, 6e+125], N[(t$95$1 * (-y)), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
t_2 := t\_1 \cdot \left(0.5 \cdot x\right)\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{-13}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+125}:\\
\;\;\;\;t\_1 \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -3.5999999999999998e-13 or 6.0000000000000003e125 < x Initial program 99.9%
Simplified0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
if -3.5999999999999998e-13 < x < 6.0000000000000003e125Initial program 99.3%
Simplified0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (* (- (* x 0.5) y) (+ (* 0.5 (* t t)) 1.0))))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * (((x * 0.5) - y) * ((0.5 * (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 = sqrt((z * 2.0d0)) * (((x * 0.5d0) - y) * ((0.5d0 * (t * t)) + 1.0d0))
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * (((x * 0.5) - y) * ((0.5 * (t * t)) + 1.0));
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * (((x * 0.5) - y) * ((0.5 * (t * t)) + 1.0))
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(Float64(x * 0.5) - y) * Float64(Float64(0.5 * Float64(t * t)) + 1.0))) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * (((x * 0.5) - y) * ((0.5 * (t * t)) + 1.0)); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[(N[(0.5 * N[(t * t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(\left(x \cdot 0.5 - y\right) \cdot \left(0.5 \cdot \left(t \cdot t\right) + 1\right)\right)
\end{array}
Initial program 99.5%
Simplified0
Taylor expanded in t around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (sqrt (* z 2.0)))) (if (<= t 0.00042) (* t_1 (- (* 0.5 x) y)) (* t_1 (* x (- 0.5 (/ y x)))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z * 2.0));
double tmp;
if (t <= 0.00042) {
tmp = t_1 * ((0.5 * x) - y);
} else {
tmp = t_1 * (x * (0.5 - (y / 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) :: t_1
real(8) :: tmp
t_1 = sqrt((z * 2.0d0))
if (t <= 0.00042d0) then
tmp = t_1 * ((0.5d0 * x) - y)
else
tmp = t_1 * (x * (0.5d0 - (y / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z * 2.0));
double tmp;
if (t <= 0.00042) {
tmp = t_1 * ((0.5 * x) - y);
} else {
tmp = t_1 * (x * (0.5 - (y / x)));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((z * 2.0)) tmp = 0 if t <= 0.00042: tmp = t_1 * ((0.5 * x) - y) else: tmp = t_1 * (x * (0.5 - (y / x))) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(z * 2.0)) tmp = 0.0 if (t <= 0.00042) tmp = Float64(t_1 * Float64(Float64(0.5 * x) - y)); else tmp = Float64(t_1 * Float64(x * Float64(0.5 - Float64(y / x)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((z * 2.0)); tmp = 0.0; if (t <= 0.00042) tmp = t_1 * ((0.5 * x) - y); else tmp = t_1 * (x * (0.5 - (y / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 0.00042], N[(t$95$1 * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(x * N[(0.5 - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot 2}\\
\mathbf{if}\;t \leq 0.00042:\\
\;\;\;\;t\_1 \cdot \left(0.5 \cdot x - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(x \cdot \left(0.5 - \frac{y}{x}\right)\right)\\
\end{array}
\end{array}
if t < 4.2000000000000002e-4Initial program 99.3%
Simplified0
Taylor expanded in t around 0 0
Simplified0
if 4.2000000000000002e-4 < t Initial program 100.0%
Simplified0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (* (- (* x 0.5) y) (sqrt (* z (* 2.0 (+ (* t t) 1.0))))))
double code(double x, double y, double z, double t) {
return ((x * 0.5) - y) * sqrt((z * (2.0 * ((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((z * (2.0d0 * ((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((z * (2.0 * ((t * t) + 1.0))));
}
def code(x, y, z, t): return ((x * 0.5) - y) * math.sqrt((z * (2.0 * ((t * t) + 1.0))))
function code(x, y, z, t) return Float64(Float64(Float64(x * 0.5) - y) * sqrt(Float64(z * Float64(2.0 * Float64(Float64(t * t) + 1.0))))) end
function tmp = code(x, y, z, t) tmp = ((x * 0.5) - y) * sqrt((z * (2.0 * ((t * t) + 1.0)))); end
code[x_, y_, z_, t_] := N[(N[(N[(x * 0.5), $MachinePrecision] - y), $MachinePrecision] * N[Sqrt[N[(z * N[(2.0 * N[(N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 0.5 - y\right) \cdot \sqrt{z \cdot \left(2 \cdot \left(t \cdot t + 1\right)\right)}
\end{array}
Initial program 99.5%
Simplified0
Applied egg-rr0
Taylor expanded in t around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (- (* 0.5 x) y)))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * ((0.5 * x) - 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((z * 2.0d0)) * ((0.5d0 * x) - y)
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * ((0.5 * x) - y);
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * ((0.5 * x) - y)
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(Float64(0.5 * x) - y)) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * ((0.5 * x) - y); end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.5 * x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(0.5 \cdot x - y\right)
\end{array}
Initial program 99.5%
Simplified0
Taylor expanded in t around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (* (sqrt (* z 2.0)) (- y)))
double code(double x, double y, double z, double t) {
return sqrt((z * 2.0)) * -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((z * 2.0d0)) * -y
end function
public static double code(double x, double y, double z, double t) {
return Math.sqrt((z * 2.0)) * -y;
}
def code(x, y, z, t): return math.sqrt((z * 2.0)) * -y
function code(x, y, z, t) return Float64(sqrt(Float64(z * 2.0)) * Float64(-y)) end
function tmp = code(x, y, z, t) tmp = sqrt((z * 2.0)) * -y; end
code[x_, y_, z_, t_] := N[(N[Sqrt[N[(z * 2.0), $MachinePrecision]], $MachinePrecision] * (-y)), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{z \cdot 2} \cdot \left(-y\right)
\end{array}
Initial program 99.5%
Simplified0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
(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 2024110
(FPCore (x y z t)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, A"
:precision binary64
:alt
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (pow (exp 1.0) (/ (* t t) 2.0)))
(* (* (- (* x 0.5) y) (sqrt (* z 2.0))) (exp (/ (* t t) 2.0))))