
(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 8 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 (if (<= v -2.15e+139) (atan -1.0) (if (<= v 2e+73) (atan (* v (pow (fma v v (* H -19.6)) -0.5))) (atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -2.15e+139) {
tmp = atan(-1.0);
} else if (v <= 2e+73) {
tmp = atan((v * pow(fma(v, v, (H * -19.6)), -0.5)));
} else {
tmp = atan(1.0);
}
return tmp;
}
function code(v, H) tmp = 0.0 if (v <= -2.15e+139) tmp = atan(-1.0); elseif (v <= 2e+73) tmp = atan(Float64(v * (fma(v, v, Float64(H * -19.6)) ^ -0.5))); else tmp = atan(1.0); end return tmp end
code[v_, H_] := If[LessEqual[v, -2.15e+139], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 2e+73], N[ArcTan[N[(v * N[Power[N[(v * v + N[(H * -19.6), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2.15 \cdot 10^{+139}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 2 \cdot 10^{+73}:\\
\;\;\;\;\tan^{-1} \left(v \cdot {\left(\mathsf{fma}\left(v, v, H \cdot -19.6\right)\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -2.1499999999999999e139Initial program 5.0%
sqr-neg5.0%
sqr-neg5.0%
metadata-eval5.0%
Simplified5.0%
Taylor expanded in v around -inf 100.0%
if -2.1499999999999999e139 < v < 1.99999999999999997e73Initial program 99.7%
sqr-neg99.7%
sqr-neg99.7%
metadata-eval99.7%
Simplified99.7%
add-cbrt-cube75.3%
pow1/371.2%
add-sqr-sqrt71.2%
pow171.2%
pow1/271.2%
pow-prod-up71.2%
sub-neg71.2%
+-commutative71.2%
*-commutative71.2%
distribute-rgt-neg-in71.2%
fma-define71.2%
metadata-eval71.2%
pow271.2%
metadata-eval71.2%
Applied egg-rr71.2%
unpow1/375.4%
Simplified75.4%
pow1/371.2%
pow-pow99.7%
metadata-eval99.7%
pow1/299.7%
fma-undefine99.7%
+-commutative99.7%
unpow299.7%
add-sqr-sqrt80.0%
hypot-undefine80.0%
add-sqr-sqrt79.6%
sqrt-unprod80.0%
sqr-neg80.0%
sqrt-unprod0.0%
add-sqr-sqrt10.6%
un-div-inv10.6%
*-commutative10.6%
Applied egg-rr80.0%
inv-pow80.0%
hypot-undefine80.0%
sqrt-pow279.9%
add-sqr-sqrt99.8%
fma-define99.8%
metadata-eval99.8%
Applied egg-rr99.8%
if 1.99999999999999997e73 < v Initial program 36.5%
sqr-neg36.5%
sqr-neg36.5%
metadata-eval36.5%
Simplified36.5%
Taylor expanded in v around inf 100.0%
Final simplification99.9%
(FPCore (v H) :precision binary64 (if (<= v -1e+156) (atan -1.0) (if (<= v 2e+73) (atan (/ v (sqrt (- (* v v) (* H 19.6))))) (atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -1e+156) {
tmp = atan(-1.0);
} else if (v <= 2e+73) {
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 <= (-1d+156)) then
tmp = atan((-1.0d0))
else if (v <= 2d+73) 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 <= -1e+156) {
tmp = Math.atan(-1.0);
} else if (v <= 2e+73) {
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 <= -1e+156: tmp = math.atan(-1.0) elif v <= 2e+73: 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 <= -1e+156) tmp = atan(-1.0); elseif (v <= 2e+73) 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 <= -1e+156) tmp = atan(-1.0); elseif (v <= 2e+73) 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, -1e+156], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 2e+73], 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 -1 \cdot 10^{+156}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 2 \cdot 10^{+73}:\\
\;\;\;\;\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 < -9.9999999999999998e155Initial program 3.1%
sqr-neg3.1%
sqr-neg3.1%
metadata-eval3.1%
Simplified3.1%
Taylor expanded in v around -inf 100.0%
if -9.9999999999999998e155 < v < 1.99999999999999997e73Initial program 99.7%
sqr-neg99.7%
sqr-neg99.7%
metadata-eval99.7%
Simplified99.7%
if 1.99999999999999997e73 < v Initial program 36.5%
sqr-neg36.5%
sqr-neg36.5%
metadata-eval36.5%
Simplified36.5%
Taylor expanded in v around inf 100.0%
Final simplification99.9%
(FPCore (v H) :precision binary64 (if (<= v -3.8e-247) (atan (/ v (- (fma -9.8 (/ H v) v)))) (atan (/ v (+ v (* -9.8 (/ H v)))))))
double code(double v, double H) {
double tmp;
if (v <= -3.8e-247) {
tmp = atan((v / -fma(-9.8, (H / v), v)));
} else {
tmp = atan((v / (v + (-9.8 * (H / v)))));
}
return tmp;
}
function code(v, H) tmp = 0.0 if (v <= -3.8e-247) tmp = atan(Float64(v / Float64(-fma(-9.8, Float64(H / v), v)))); else tmp = atan(Float64(v / Float64(v + Float64(-9.8 * Float64(H / v))))); end return tmp end
code[v_, H_] := If[LessEqual[v, -3.8e-247], N[ArcTan[N[(v / (-N[(-9.8 * N[(H / 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 -3.8 \cdot 10^{-247}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{-\mathsf{fma}\left(-9.8, \frac{H}{v}, v\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + -9.8 \cdot \frac{H}{v}}\right)\\
\end{array}
\end{array}
if v < -3.79999999999999988e-247Initial program 61.7%
sqr-neg61.7%
sqr-neg61.7%
metadata-eval61.7%
Simplified61.7%
Taylor expanded in H around 0 3.4%
+-commutative3.4%
fma-define3.4%
Simplified3.4%
frac-2neg3.4%
neg-sub03.4%
div-sub3.4%
add-sqr-sqrt0.0%
sqrt-prod42.6%
sqr-neg42.6%
sqrt-unprod74.3%
add-sqr-sqrt74.7%
frac-2neg74.7%
Applied egg-rr74.7%
div074.7%
neg-sub074.7%
distribute-neg-frac274.7%
Simplified74.7%
if -3.79999999999999988e-247 < v Initial program 68.6%
sqr-neg68.6%
sqr-neg68.6%
metadata-eval68.6%
Simplified68.6%
Taylor expanded in H around 0 70.9%
(FPCore (v H) :precision binary64 (if (<= v -3.6e-148) (atan -1.0) (if (<= v 2.5e-138) (atan (/ v (* H (/ 9.8 v)))) (atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -3.6e-148) {
tmp = atan(-1.0);
} else if (v <= 2.5e-138) {
tmp = atan((v / (H * (9.8 / 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 <= (-3.6d-148)) then
tmp = atan((-1.0d0))
else if (v <= 2.5d-138) then
tmp = atan((v / (h * (9.8d0 / v))))
else
tmp = atan(1.0d0)
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -3.6e-148) {
tmp = Math.atan(-1.0);
} else if (v <= 2.5e-138) {
tmp = Math.atan((v / (H * (9.8 / v))));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -3.6e-148: tmp = math.atan(-1.0) elif v <= 2.5e-138: tmp = math.atan((v / (H * (9.8 / v)))) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -3.6e-148) tmp = atan(-1.0); elseif (v <= 2.5e-138) tmp = atan(Float64(v / Float64(H * Float64(9.8 / v)))); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -3.6e-148) tmp = atan(-1.0); elseif (v <= 2.5e-138) tmp = atan((v / (H * (9.8 / v)))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -3.6e-148], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 2.5e-138], N[ArcTan[N[(v / N[(H * N[(9.8 / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -3.6 \cdot 10^{-148}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 2.5 \cdot 10^{-138}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{H \cdot \frac{9.8}{v}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -3.5999999999999998e-148Initial program 56.5%
sqr-neg56.5%
sqr-neg56.5%
metadata-eval56.5%
Simplified56.5%
Taylor expanded in v around -inf 82.2%
if -3.5999999999999998e-148 < v < 2.49999999999999994e-138Initial program 99.6%
sqr-neg99.6%
sqr-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in H around 0 28.9%
+-commutative28.9%
fma-define28.9%
Simplified28.9%
Taylor expanded in H around inf 28.9%
associate-*r/28.9%
frac-2neg28.9%
add-sqr-sqrt13.5%
sqrt-unprod28.9%
sqr-neg28.9%
sqrt-unprod15.2%
add-sqr-sqrt29.2%
Applied egg-rr29.2%
distribute-lft-neg-in29.2%
metadata-eval29.2%
*-commutative29.2%
*-lft-identity29.2%
times-frac29.2%
/-rgt-identity29.2%
Simplified29.2%
if 2.49999999999999994e-138 < v Initial program 57.4%
sqr-neg57.4%
sqr-neg57.4%
metadata-eval57.4%
Simplified57.4%
Taylor expanded in v around inf 82.8%
(FPCore (v H)
:precision binary64
(if (<= v -2.6e-191)
(atan -1.0)
(if (<= v 5.4e-130)
(atan (* -0.10204081632653061 (/ v (/ H v))))
(atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -2.6e-191) {
tmp = atan(-1.0);
} else if (v <= 5.4e-130) {
tmp = atan((-0.10204081632653061 * (v / (H / 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 <= (-2.6d-191)) then
tmp = atan((-1.0d0))
else if (v <= 5.4d-130) then
tmp = atan(((-0.10204081632653061d0) * (v / (h / v))))
else
tmp = atan(1.0d0)
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -2.6e-191) {
tmp = Math.atan(-1.0);
} else if (v <= 5.4e-130) {
tmp = Math.atan((-0.10204081632653061 * (v / (H / v))));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -2.6e-191: tmp = math.atan(-1.0) elif v <= 5.4e-130: tmp = math.atan((-0.10204081632653061 * (v / (H / v)))) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -2.6e-191) tmp = atan(-1.0); elseif (v <= 5.4e-130) tmp = atan(Float64(-0.10204081632653061 * Float64(v / Float64(H / v)))); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -2.6e-191) tmp = atan(-1.0); elseif (v <= 5.4e-130) tmp = atan((-0.10204081632653061 * (v / (H / v)))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -2.6e-191], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 5.4e-130], N[ArcTan[N[(-0.10204081632653061 * N[(v / N[(H / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2.6 \cdot 10^{-191}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 5.4 \cdot 10^{-130}:\\
\;\;\;\;\tan^{-1} \left(-0.10204081632653061 \cdot \frac{v}{\frac{H}{v}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -2.59999999999999986e-191Initial program 59.9%
sqr-neg59.9%
sqr-neg59.9%
metadata-eval59.9%
Simplified59.9%
Taylor expanded in v around -inf 76.1%
if -2.59999999999999986e-191 < v < 5.39999999999999982e-130Initial program 99.6%
sqr-neg99.6%
sqr-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in H around 0 35.1%
+-commutative35.1%
fma-define35.1%
Simplified35.1%
Taylor expanded in H around inf 35.1%
*-un-lft-identity35.1%
times-frac35.1%
metadata-eval35.1%
Applied egg-rr35.1%
if 5.39999999999999982e-130 < v Initial program 57.4%
sqr-neg57.4%
sqr-neg57.4%
metadata-eval57.4%
Simplified57.4%
Taylor expanded in v around inf 82.8%
(FPCore (v H) :precision binary64 (if (<= v -2.5e-191) (atan -1.0) (atan (/ v (+ v (* -9.8 (/ H v)))))))
double code(double v, double H) {
double tmp;
if (v <= -2.5e-191) {
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 <= (-2.5d-191)) 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 <= -2.5e-191) {
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 <= -2.5e-191: 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 <= -2.5e-191) 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 <= -2.5e-191) tmp = atan(-1.0); else tmp = atan((v / (v + (-9.8 * (H / v))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -2.5e-191], 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 -2.5 \cdot 10^{-191}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + -9.8 \cdot \frac{H}{v}}\right)\\
\end{array}
\end{array}
if v < -2.5e-191Initial program 59.9%
sqr-neg59.9%
sqr-neg59.9%
metadata-eval59.9%
Simplified59.9%
Taylor expanded in v around -inf 76.1%
if -2.5e-191 < v Initial program 70.0%
sqr-neg70.0%
sqr-neg70.0%
metadata-eval70.0%
Simplified70.0%
Taylor expanded in H around 0 69.0%
(FPCore (v H) :precision binary64 (if (<= v -2e-310) (atan -1.0) (atan 1.0)))
double code(double v, double H) {
double tmp;
if (v <= -2e-310) {
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 <= (-2d-310)) 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 <= -2e-310) {
tmp = Math.atan(-1.0);
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -2e-310: tmp = math.atan(-1.0) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -2e-310) tmp = atan(-1.0); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -2e-310) tmp = atan(-1.0); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -2e-310], N[ArcTan[-1.0], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -1.999999999999994e-310Initial program 64.1%
sqr-neg64.1%
sqr-neg64.1%
metadata-eval64.1%
Simplified64.1%
Taylor expanded in v around -inf 68.3%
if -1.999999999999994e-310 < v Initial program 66.2%
sqr-neg66.2%
sqr-neg66.2%
metadata-eval66.2%
Simplified66.2%
Taylor expanded in v around inf 66.3%
(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 65.0%
sqr-neg65.0%
sqr-neg65.0%
metadata-eval65.0%
Simplified65.0%
Taylor expanded in v around -inf 38.5%
herbie shell --seed 2024102
(FPCore (v H)
:name "Optimal throwing angle"
:precision binary64
(atan (/ v (sqrt (- (* v v) (* (* 2.0 9.8) H))))))