
(FPCore (v H) :precision binary64 (atan (/ v (sqrt (- (* v v) (* (* 2.0 9.8) H))))))
double code(double v, double H) {
return atan((v / sqrt(((v * v) - ((2.0 * 9.8) * H)))));
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
code = atan((v / sqrt(((v * v) - ((2.0d0 * 9.8d0) * h)))))
end function
public static double code(double v, double H) {
return Math.atan((v / Math.sqrt(((v * v) - ((2.0 * 9.8) * H)))));
}
def code(v, H): return math.atan((v / math.sqrt(((v * v) - ((2.0 * 9.8) * H)))))
function code(v, H) return atan(Float64(v / sqrt(Float64(Float64(v * v) - Float64(Float64(2.0 * 9.8) * H))))) end
function tmp = code(v, H) tmp = atan((v / sqrt(((v * v) - ((2.0 * 9.8) * H))))); end
code[v_, H_] := N[ArcTan[N[(v / N[Sqrt[N[(N[(v * v), $MachinePrecision] - N[(N[(2.0 * 9.8), $MachinePrecision] * H), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (v H) :precision binary64 (atan (/ v (sqrt (- (* v v) (* (* 2.0 9.8) H))))))
double code(double v, double H) {
return atan((v / sqrt(((v * v) - ((2.0 * 9.8) * H)))));
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
code = atan((v / sqrt(((v * v) - ((2.0d0 * 9.8d0) * h)))))
end function
public static double code(double v, double H) {
return Math.atan((v / Math.sqrt(((v * v) - ((2.0 * 9.8) * H)))));
}
def code(v, H): return math.atan((v / math.sqrt(((v * v) - ((2.0 * 9.8) * H)))))
function code(v, H) return atan(Float64(v / sqrt(Float64(Float64(v * v) - Float64(Float64(2.0 * 9.8) * H))))) end
function tmp = code(v, H) tmp = atan((v / sqrt(((v * v) - ((2.0 * 9.8) * H))))); end
code[v_, H_] := N[ArcTan[N[(v / N[Sqrt[N[(N[(v * v), $MachinePrecision] - N[(N[(2.0 * 9.8), $MachinePrecision] * H), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right)
\end{array}
(FPCore (v H)
:precision binary64
(let* ((t_0 (+ (* v v) (* H 19.6))))
(if (<= v -5e+154)
(atan -1.0)
(if (<= v 4.4e+124)
(atan (/ v (sqrt (* (+ (* v v) (* H -19.6)) (* t_0 (/ 1.0 t_0))))))
(atan 1.0)))))
double code(double v, double H) {
double t_0 = (v * v) + (H * 19.6);
double tmp;
if (v <= -5e+154) {
tmp = atan(-1.0);
} else if (v <= 4.4e+124) {
tmp = atan((v / sqrt((((v * v) + (H * -19.6)) * (t_0 * (1.0 / t_0))))));
} else {
tmp = atan(1.0);
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: t_0
real(8) :: tmp
t_0 = (v * v) + (h * 19.6d0)
if (v <= (-5d+154)) then
tmp = atan((-1.0d0))
else if (v <= 4.4d+124) then
tmp = atan((v / sqrt((((v * v) + (h * (-19.6d0))) * (t_0 * (1.0d0 / t_0))))))
else
tmp = atan(1.0d0)
end if
code = tmp
end function
public static double code(double v, double H) {
double t_0 = (v * v) + (H * 19.6);
double tmp;
if (v <= -5e+154) {
tmp = Math.atan(-1.0);
} else if (v <= 4.4e+124) {
tmp = Math.atan((v / Math.sqrt((((v * v) + (H * -19.6)) * (t_0 * (1.0 / t_0))))));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): t_0 = (v * v) + (H * 19.6) tmp = 0 if v <= -5e+154: tmp = math.atan(-1.0) elif v <= 4.4e+124: tmp = math.atan((v / math.sqrt((((v * v) + (H * -19.6)) * (t_0 * (1.0 / t_0)))))) else: tmp = math.atan(1.0) return tmp
function code(v, H) t_0 = Float64(Float64(v * v) + Float64(H * 19.6)) tmp = 0.0 if (v <= -5e+154) tmp = atan(-1.0); elseif (v <= 4.4e+124) tmp = atan(Float64(v / sqrt(Float64(Float64(Float64(v * v) + Float64(H * -19.6)) * Float64(t_0 * Float64(1.0 / t_0)))))); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) t_0 = (v * v) + (H * 19.6); tmp = 0.0; if (v <= -5e+154) tmp = atan(-1.0); elseif (v <= 4.4e+124) tmp = atan((v / sqrt((((v * v) + (H * -19.6)) * (t_0 * (1.0 / t_0)))))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := Block[{t$95$0 = N[(N[(v * v), $MachinePrecision] + N[(H * 19.6), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[v, -5e+154], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 4.4e+124], N[ArcTan[N[(v / N[Sqrt[N[(N[(N[(v * v), $MachinePrecision] + N[(H * -19.6), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := v \cdot v + H \cdot 19.6\\
\mathbf{if}\;v \leq -5 \cdot 10^{+154}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 4.4 \cdot 10^{+124}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\sqrt{\left(v \cdot v + H \cdot -19.6\right) \cdot \left(t\_0 \cdot \frac{1}{t\_0}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -5.00000000000000004e154Initial program 3.1%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval3.1%
Simplified3.1%
Taylor expanded in v around -inf
Simplified100.0%
if -5.00000000000000004e154 < v < 4.4000000000000002e124Initial program 99.8%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval99.8%
Simplified99.8%
flip-+N/A
fmm-defN/A
*-commutativeN/A
div-invN/A
difference-of-squaresN/A
fmm-defN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
Applied egg-rr99.8%
if 4.4000000000000002e124 < v Initial program 32.0%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval32.0%
Simplified32.0%
Taylor expanded in v around inf
Simplified100.0%
(FPCore (v H) :precision binary64 (if (<= v -5e+154) (atan -1.0) (if (<= v 5e+120) (atan (/ v (sqrt (+ (* v v) (* H -19.6))))) (atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -5e+154) {
tmp = atan(-1.0);
} else if (v <= 5e+120) {
tmp = atan((v / sqrt(((v * v) + (H * -19.6)))));
} else {
tmp = atan(1.0);
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: tmp
if (v <= (-5d+154)) then
tmp = atan((-1.0d0))
else if (v <= 5d+120) then
tmp = atan((v / sqrt(((v * v) + (h * (-19.6d0))))))
else
tmp = atan(1.0d0)
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -5e+154) {
tmp = Math.atan(-1.0);
} else if (v <= 5e+120) {
tmp = Math.atan((v / Math.sqrt(((v * v) + (H * -19.6)))));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -5e+154: tmp = math.atan(-1.0) elif v <= 5e+120: tmp = math.atan((v / math.sqrt(((v * v) + (H * -19.6))))) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -5e+154) tmp = atan(-1.0); elseif (v <= 5e+120) tmp = atan(Float64(v / sqrt(Float64(Float64(v * v) + Float64(H * -19.6))))); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -5e+154) tmp = atan(-1.0); elseif (v <= 5e+120) tmp = atan((v / sqrt(((v * v) + (H * -19.6))))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -5e+154], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 5e+120], N[ArcTan[N[(v / N[Sqrt[N[(N[(v * v), $MachinePrecision] + N[(H * -19.6), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -5 \cdot 10^{+154}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 5 \cdot 10^{+120}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -5.00000000000000004e154Initial program 3.1%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval3.1%
Simplified3.1%
Taylor expanded in v around -inf
Simplified100.0%
if -5.00000000000000004e154 < v < 5.00000000000000019e120Initial program 99.8%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval99.8%
Simplified99.8%
if 5.00000000000000019e120 < v Initial program 32.0%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval32.0%
Simplified32.0%
Taylor expanded in v around inf
Simplified100.0%
(FPCore (v H)
:precision binary64
(if (<= v -2.9e-63)
(atan
(+ -1.0 (* H (+ (/ (* H -96.04) (* v (* v (* v v)))) (/ -9.8 (* v v))))))
(if (<= v 4e-121)
(atan (* v (sqrt (/ -0.05102040816326531 H))))
(atan (/ v (+ v (* -9.8 (/ H v))))))))
double code(double v, double H) {
double tmp;
if (v <= -2.9e-63) {
tmp = atan((-1.0 + (H * (((H * -96.04) / (v * (v * (v * v)))) + (-9.8 / (v * v))))));
} else if (v <= 4e-121) {
tmp = atan((v * sqrt((-0.05102040816326531 / H))));
} else {
tmp = atan((v / (v + (-9.8 * (H / v)))));
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: tmp
if (v <= (-2.9d-63)) then
tmp = atan(((-1.0d0) + (h * (((h * (-96.04d0)) / (v * (v * (v * v)))) + ((-9.8d0) / (v * v))))))
else if (v <= 4d-121) then
tmp = atan((v * sqrt(((-0.05102040816326531d0) / h))))
else
tmp = atan((v / (v + ((-9.8d0) * (h / v)))))
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -2.9e-63) {
tmp = Math.atan((-1.0 + (H * (((H * -96.04) / (v * (v * (v * v)))) + (-9.8 / (v * v))))));
} else if (v <= 4e-121) {
tmp = Math.atan((v * Math.sqrt((-0.05102040816326531 / H))));
} else {
tmp = Math.atan((v / (v + (-9.8 * (H / v)))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -2.9e-63: tmp = math.atan((-1.0 + (H * (((H * -96.04) / (v * (v * (v * v)))) + (-9.8 / (v * v)))))) elif v <= 4e-121: tmp = math.atan((v * math.sqrt((-0.05102040816326531 / H)))) else: tmp = math.atan((v / (v + (-9.8 * (H / v))))) return tmp
function code(v, H) tmp = 0.0 if (v <= -2.9e-63) tmp = atan(Float64(-1.0 + Float64(H * Float64(Float64(Float64(H * -96.04) / Float64(v * Float64(v * Float64(v * v)))) + Float64(-9.8 / Float64(v * v)))))); elseif (v <= 4e-121) tmp = atan(Float64(v * sqrt(Float64(-0.05102040816326531 / H)))); else tmp = atan(Float64(v / Float64(v + Float64(-9.8 * Float64(H / v))))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -2.9e-63) tmp = atan((-1.0 + (H * (((H * -96.04) / (v * (v * (v * v)))) + (-9.8 / (v * v)))))); elseif (v <= 4e-121) tmp = atan((v * sqrt((-0.05102040816326531 / H)))); else tmp = atan((v / (v + (-9.8 * (H / v))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -2.9e-63], N[ArcTan[N[(-1.0 + N[(H * N[(N[(N[(H * -96.04), $MachinePrecision] / N[(v * N[(v * N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-9.8 / N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[v, 4e-121], N[ArcTan[N[(v * N[Sqrt[N[(-0.05102040816326531 / H), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(v / N[(v + N[(-9.8 * N[(H / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2.9 \cdot 10^{-63}:\\
\;\;\;\;\tan^{-1} \left(-1 + H \cdot \left(\frac{H \cdot -96.04}{v \cdot \left(v \cdot \left(v \cdot v\right)\right)} + \frac{-9.8}{v \cdot v}\right)\right)\\
\mathbf{elif}\;v \leq 4 \cdot 10^{-121}:\\
\;\;\;\;\tan^{-1} \left(v \cdot \sqrt{\frac{-0.05102040816326531}{H}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + -9.8 \cdot \frac{H}{v}}\right)\\
\end{array}
\end{array}
if v < -2.89999999999999975e-63Initial program 59.1%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval59.1%
Simplified59.1%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6459.1%
Applied egg-rr59.1%
Taylor expanded in v around -inf
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6491.2%
Simplified91.2%
Taylor expanded in H around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
+-lowering-+.f64N/A
Simplified91.4%
if -2.89999999999999975e-63 < v < 3.9999999999999999e-121Initial program 99.7%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval99.7%
Simplified99.7%
Taylor expanded in v around 0
atan-lowering-atan.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.7%
Simplified99.7%
Taylor expanded in H around inf
/-lowering-/.f6489.9%
Simplified89.9%
if 3.9999999999999999e-121 < v Initial program 68.3%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval68.3%
Simplified68.3%
Taylor expanded in H around 0
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6479.8%
Simplified79.8%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6479.8%
Applied egg-rr79.8%
(FPCore (v H) :precision binary64 (if (<= v -9.6e-139) (atan -1.0) (if (<= v 1.16e-172) (atan (/ 1.0 (/ (/ (* H 9.8) v) v))) (atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -9.6e-139) {
tmp = atan(-1.0);
} else if (v <= 1.16e-172) {
tmp = atan((1.0 / (((H * 9.8) / v) / v)));
} else {
tmp = atan(1.0);
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: tmp
if (v <= (-9.6d-139)) then
tmp = atan((-1.0d0))
else if (v <= 1.16d-172) then
tmp = atan((1.0d0 / (((h * 9.8d0) / v) / v)))
else
tmp = atan(1.0d0)
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -9.6e-139) {
tmp = Math.atan(-1.0);
} else if (v <= 1.16e-172) {
tmp = Math.atan((1.0 / (((H * 9.8) / v) / v)));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -9.6e-139: tmp = math.atan(-1.0) elif v <= 1.16e-172: tmp = math.atan((1.0 / (((H * 9.8) / v) / v))) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -9.6e-139) tmp = atan(-1.0); elseif (v <= 1.16e-172) tmp = atan(Float64(1.0 / Float64(Float64(Float64(H * 9.8) / v) / v))); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -9.6e-139) tmp = atan(-1.0); elseif (v <= 1.16e-172) tmp = atan((1.0 / (((H * 9.8) / v) / v))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -9.6e-139], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 1.16e-172], N[ArcTan[N[(1.0 / N[(N[(N[(H * 9.8), $MachinePrecision] / v), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -9.6 \cdot 10^{-139}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 1.16 \cdot 10^{-172}:\\
\;\;\;\;\tan^{-1} \left(\frac{1}{\frac{\frac{H \cdot 9.8}{v}}{v}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -9.60000000000000059e-139Initial program 66.7%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval66.7%
Simplified66.7%
Taylor expanded in v around -inf
Simplified81.6%
if -9.60000000000000059e-139 < v < 1.1599999999999999e-172Initial program 99.7%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval99.7%
Simplified99.7%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.6%
Applied egg-rr99.6%
Taylor expanded in v around -inf
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6431.6%
Simplified31.6%
Taylor expanded in v around 0
associate-*r/N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6431.6%
Simplified31.6%
if 1.1599999999999999e-172 < v Initial program 70.6%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval70.6%
Simplified70.6%
Taylor expanded in v around inf
Simplified74.9%
(FPCore (v H)
:precision binary64
(if (<= v -5.4e-139)
(atan -1.0)
(if (<= v 1.7e-147)
(atan (* (* v -0.10204081632653061) (/ v H)))
(atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -5.4e-139) {
tmp = atan(-1.0);
} else if (v <= 1.7e-147) {
tmp = atan(((v * -0.10204081632653061) * (v / H)));
} else {
tmp = atan(1.0);
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: tmp
if (v <= (-5.4d-139)) then
tmp = atan((-1.0d0))
else if (v <= 1.7d-147) then
tmp = atan(((v * (-0.10204081632653061d0)) * (v / h)))
else
tmp = atan(1.0d0)
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -5.4e-139) {
tmp = Math.atan(-1.0);
} else if (v <= 1.7e-147) {
tmp = Math.atan(((v * -0.10204081632653061) * (v / H)));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -5.4e-139: tmp = math.atan(-1.0) elif v <= 1.7e-147: tmp = math.atan(((v * -0.10204081632653061) * (v / H))) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -5.4e-139) tmp = atan(-1.0); elseif (v <= 1.7e-147) tmp = atan(Float64(Float64(v * -0.10204081632653061) * Float64(v / H))); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -5.4e-139) tmp = atan(-1.0); elseif (v <= 1.7e-147) tmp = atan(((v * -0.10204081632653061) * (v / H))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -5.4e-139], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 1.7e-147], N[ArcTan[N[(N[(v * -0.10204081632653061), $MachinePrecision] * N[(v / H), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -5.4 \cdot 10^{-139}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 1.7 \cdot 10^{-147}:\\
\;\;\;\;\tan^{-1} \left(\left(v \cdot -0.10204081632653061\right) \cdot \frac{v}{H}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -5.3999999999999997e-139Initial program 66.7%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval66.7%
Simplified66.7%
Taylor expanded in v around -inf
Simplified81.6%
if -5.3999999999999997e-139 < v < 1.69999999999999998e-147Initial program 99.7%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval99.7%
Simplified99.7%
Taylor expanded in H around 0
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6429.4%
Simplified29.4%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6429.4%
Applied egg-rr29.4%
Taylor expanded in v around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6429.4%
Simplified29.4%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6429.4%
Applied egg-rr29.4%
if 1.69999999999999998e-147 < v Initial program 69.5%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval69.5%
Simplified69.5%
Taylor expanded in v around inf
Simplified77.5%
(FPCore (v H) :precision binary64 (if (<= v 1.4e-292) (atan (/ v (- (/ (* H 9.8) v) v))) (atan (/ v (+ v (* -9.8 (/ H v)))))))
double code(double v, double H) {
double tmp;
if (v <= 1.4e-292) {
tmp = atan((v / (((H * 9.8) / v) - v)));
} else {
tmp = atan((v / (v + (-9.8 * (H / v)))));
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: tmp
if (v <= 1.4d-292) then
tmp = atan((v / (((h * 9.8d0) / v) - v)))
else
tmp = atan((v / (v + ((-9.8d0) * (h / v)))))
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= 1.4e-292) {
tmp = Math.atan((v / (((H * 9.8) / v) - v)));
} else {
tmp = Math.atan((v / (v + (-9.8 * (H / v)))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= 1.4e-292: tmp = math.atan((v / (((H * 9.8) / v) - v))) else: tmp = math.atan((v / (v + (-9.8 * (H / v))))) return tmp
function code(v, H) tmp = 0.0 if (v <= 1.4e-292) tmp = atan(Float64(v / Float64(Float64(Float64(H * 9.8) / v) - v))); else tmp = atan(Float64(v / Float64(v + Float64(-9.8 * Float64(H / v))))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= 1.4e-292) tmp = atan((v / (((H * 9.8) / v) - v))); else tmp = atan((v / (v + (-9.8 * (H / v))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, 1.4e-292], N[ArcTan[N[(v / N[(N[(N[(H * 9.8), $MachinePrecision] / v), $MachinePrecision] - v), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(v / N[(v + N[(-9.8 * N[(H / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq 1.4 \cdot 10^{-292}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\frac{H \cdot 9.8}{v} - v}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + -9.8 \cdot \frac{H}{v}}\right)\\
\end{array}
\end{array}
if v < 1.4000000000000001e-292Initial program 73.2%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval73.2%
Simplified73.2%
Taylor expanded in v around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified50.2%
Taylor expanded in H around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-*r/N/A
*-commutativeN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
--lowering--.f64N/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6472.3%
Simplified72.3%
if 1.4000000000000001e-292 < v Initial program 75.1%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval75.1%
Simplified75.1%
Taylor expanded in H around 0
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6468.2%
Simplified68.2%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6468.2%
Applied egg-rr68.2%
(FPCore (v H) :precision binary64 (if (<= v -7e-139) (atan -1.0) (atan (/ v (+ v (* -9.8 (/ H v)))))))
double code(double v, double H) {
double tmp;
if (v <= -7e-139) {
tmp = atan(-1.0);
} else {
tmp = atan((v / (v + (-9.8 * (H / v)))));
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: tmp
if (v <= (-7d-139)) then
tmp = atan((-1.0d0))
else
tmp = atan((v / (v + ((-9.8d0) * (h / v)))))
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -7e-139) {
tmp = Math.atan(-1.0);
} else {
tmp = Math.atan((v / (v + (-9.8 * (H / v)))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -7e-139: tmp = math.atan(-1.0) else: tmp = math.atan((v / (v + (-9.8 * (H / v))))) return tmp
function code(v, H) tmp = 0.0 if (v <= -7e-139) tmp = atan(-1.0); else tmp = atan(Float64(v / Float64(v + Float64(-9.8 * Float64(H / v))))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -7e-139) tmp = atan(-1.0); else tmp = atan((v / (v + (-9.8 * (H / v))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -7e-139], N[ArcTan[-1.0], $MachinePrecision], N[ArcTan[N[(v / N[(v + N[(-9.8 * N[(H / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -7 \cdot 10^{-139}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + -9.8 \cdot \frac{H}{v}}\right)\\
\end{array}
\end{array}
if v < -7.00000000000000002e-139Initial program 66.7%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval66.7%
Simplified66.7%
Taylor expanded in v around -inf
Simplified81.6%
if -7.00000000000000002e-139 < v Initial program 79.1%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval79.1%
Simplified79.1%
Taylor expanded in H around 0
*-commutativeN/A
associate-*l/N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6462.4%
Simplified62.4%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6462.4%
Applied egg-rr62.4%
(FPCore (v H) :precision binary64 (if (<= v -2.7e-271) (atan -1.0) (atan 1.0)))
double code(double v, double H) {
double tmp;
if (v <= -2.7e-271) {
tmp = atan(-1.0);
} else {
tmp = atan(1.0);
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: tmp
if (v <= (-2.7d-271)) then
tmp = atan((-1.0d0))
else
tmp = atan(1.0d0)
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -2.7e-271) {
tmp = Math.atan(-1.0);
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -2.7e-271: tmp = math.atan(-1.0) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -2.7e-271) tmp = atan(-1.0); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -2.7e-271) tmp = atan(-1.0); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -2.7e-271], N[ArcTan[-1.0], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2.7 \cdot 10^{-271}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -2.6999999999999999e-271Initial program 71.9%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval71.9%
Simplified71.9%
Taylor expanded in v around -inf
Simplified69.4%
if -2.6999999999999999e-271 < v Initial program 76.2%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval76.2%
Simplified76.2%
Taylor expanded in v around inf
Simplified61.2%
(FPCore (v H) :precision binary64 (atan -1.0))
double code(double v, double H) {
return atan(-1.0);
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
code = atan((-1.0d0))
end function
public static double code(double v, double H) {
return Math.atan(-1.0);
}
def code(v, H): return math.atan(-1.0)
function code(v, H) return atan(-1.0) end
function tmp = code(v, H) tmp = atan(-1.0); end
code[v_, H_] := N[ArcTan[-1.0], $MachinePrecision]
\begin{array}{l}
\\
\tan^{-1} -1
\end{array}
Initial program 74.1%
atan-lowering-atan.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sub-negN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
metadata-evalN/A
metadata-eval74.1%
Simplified74.1%
Taylor expanded in v around -inf
Simplified33.8%
herbie shell --seed 2024158
(FPCore (v H)
:name "Optimal throwing angle"
:precision binary64
(atan (/ v (sqrt (- (* v v) (* (* 2.0 9.8) H))))))