
(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 -1e+154)
(atan -1.0)
(if (<= v 1.2e+136)
(atan (* v (sqrt (/ 1.0 (- (pow v 2.0) (* 19.6 H))))))
(atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -1e+154) {
tmp = atan(-1.0);
} else if (v <= 1.2e+136) {
tmp = atan((v * sqrt((1.0 / (pow(v, 2.0) - (19.6 * 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 <= (-1d+154)) then
tmp = atan((-1.0d0))
else if (v <= 1.2d+136) then
tmp = atan((v * sqrt((1.0d0 / ((v ** 2.0d0) - (19.6d0 * h))))))
else
tmp = atan(1.0d0)
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -1e+154) {
tmp = Math.atan(-1.0);
} else if (v <= 1.2e+136) {
tmp = Math.atan((v * Math.sqrt((1.0 / (Math.pow(v, 2.0) - (19.6 * H))))));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -1e+154: tmp = math.atan(-1.0) elif v <= 1.2e+136: tmp = math.atan((v * math.sqrt((1.0 / (math.pow(v, 2.0) - (19.6 * H)))))) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -1e+154) tmp = atan(-1.0); elseif (v <= 1.2e+136) tmp = atan(Float64(v * sqrt(Float64(1.0 / Float64((v ^ 2.0) - Float64(19.6 * H)))))); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -1e+154) tmp = atan(-1.0); elseif (v <= 1.2e+136) tmp = atan((v * sqrt((1.0 / ((v ^ 2.0) - (19.6 * H)))))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -1e+154], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 1.2e+136], N[ArcTan[N[(v * N[Sqrt[N[(1.0 / N[(N[Power[v, 2.0], $MachinePrecision] - N[(19.6 * H), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -1 \cdot 10^{+154}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 1.2 \cdot 10^{+136}:\\
\;\;\;\;\tan^{-1} \left(v \cdot \sqrt{\frac{1}{{v}^{2} - 19.6 \cdot H}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -1.00000000000000004e154Initial program 3.1%
metadata-eval3.1%
Simplified3.1%
Taylor expanded in v around -inf 100.0%
if -1.00000000000000004e154 < v < 1.2e136Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in v around 0 99.8%
if 1.2e136 < v Initial program 16.2%
metadata-eval16.2%
Simplified16.2%
Taylor expanded in v around inf 100.0%
(FPCore (v H) :precision binary64 (if (<= v -1.3e+154) (atan -1.0) (if (<= v 5e+135) (atan (/ v (sqrt (fma v v (* H -19.6))))) (atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -1.3e+154) {
tmp = atan(-1.0);
} else if (v <= 5e+135) {
tmp = atan((v / sqrt(fma(v, v, (H * -19.6)))));
} else {
tmp = atan(1.0);
}
return tmp;
}
function code(v, H) tmp = 0.0 if (v <= -1.3e+154) tmp = atan(-1.0); elseif (v <= 5e+135) tmp = atan(Float64(v / sqrt(fma(v, v, Float64(H * -19.6))))); else tmp = atan(1.0); end return tmp end
code[v_, H_] := If[LessEqual[v, -1.3e+154], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 5e+135], N[ArcTan[N[(v / N[Sqrt[N[(v * v + 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.3 \cdot 10^{+154}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 5 \cdot 10^{+135}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\sqrt{\mathsf{fma}\left(v, v, H \cdot -19.6\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -1.29999999999999994e154Initial program 3.1%
metadata-eval3.1%
Simplified3.1%
Taylor expanded in v around -inf 100.0%
if -1.29999999999999994e154 < v < 5.00000000000000029e135Initial program 99.8%
sqr-neg99.8%
sqr-neg99.8%
fmm-def99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
if 5.00000000000000029e135 < v Initial program 16.2%
metadata-eval16.2%
Simplified16.2%
Taylor expanded in v around inf 100.0%
(FPCore (v H) :precision binary64 (if (<= v -1e+154) (atan -1.0) (if (<= v 5e+135) (atan (/ v (sqrt (- (* v v) (* 19.6 H))))) (atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -1e+154) {
tmp = atan(-1.0);
} else if (v <= 5e+135) {
tmp = atan((v / sqrt(((v * v) - (19.6 * 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 <= (-1d+154)) then
tmp = atan((-1.0d0))
else if (v <= 5d+135) then
tmp = atan((v / sqrt(((v * v) - (19.6d0 * h)))))
else
tmp = atan(1.0d0)
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -1e+154) {
tmp = Math.atan(-1.0);
} else if (v <= 5e+135) {
tmp = Math.atan((v / Math.sqrt(((v * v) - (19.6 * H)))));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -1e+154: tmp = math.atan(-1.0) elif v <= 5e+135: tmp = math.atan((v / math.sqrt(((v * v) - (19.6 * H))))) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -1e+154) tmp = atan(-1.0); elseif (v <= 5e+135) tmp = atan(Float64(v / sqrt(Float64(Float64(v * v) - Float64(19.6 * H))))); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -1e+154) tmp = atan(-1.0); elseif (v <= 5e+135) tmp = atan((v / sqrt(((v * v) - (19.6 * H))))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -1e+154], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 5e+135], N[ArcTan[N[(v / N[Sqrt[N[(N[(v * v), $MachinePrecision] - N[(19.6 * H), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -1 \cdot 10^{+154}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 5 \cdot 10^{+135}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - 19.6 \cdot H}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -1.00000000000000004e154Initial program 3.1%
metadata-eval3.1%
Simplified3.1%
Taylor expanded in v around -inf 100.0%
if -1.00000000000000004e154 < v < 5.00000000000000029e135Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
if 5.00000000000000029e135 < v Initial program 16.2%
metadata-eval16.2%
Simplified16.2%
Taylor expanded in v around inf 100.0%
(FPCore (v H)
:precision binary64
(if (<= v -0.0235)
(atan -1.0)
(if (<= v 100000.0)
(atan (* v (sqrt (/ -0.05102040816326531 H))))
(atan (/ v (+ v (* -9.8 (/ H v))))))))
double code(double v, double H) {
double tmp;
if (v <= -0.0235) {
tmp = atan(-1.0);
} else if (v <= 100000.0) {
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 <= (-0.0235d0)) then
tmp = atan((-1.0d0))
else if (v <= 100000.0d0) 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 <= -0.0235) {
tmp = Math.atan(-1.0);
} else if (v <= 100000.0) {
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 <= -0.0235: tmp = math.atan(-1.0) elif v <= 100000.0: 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 <= -0.0235) tmp = atan(-1.0); elseif (v <= 100000.0) 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 <= -0.0235) tmp = atan(-1.0); elseif (v <= 100000.0) 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, -0.0235], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 100000.0], 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 -0.0235:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 100000:\\
\;\;\;\;\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 < -0.0235Initial program 57.4%
metadata-eval57.4%
Simplified57.4%
Taylor expanded in v around -inf 94.2%
if -0.0235 < v < 1e5Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in v around 0 99.7%
Taylor expanded in v around 0 88.8%
if 1e5 < v Initial program 50.4%
sqr-neg50.4%
sqr-neg50.4%
fmm-def50.4%
*-commutative50.4%
distribute-rgt-neg-in50.4%
metadata-eval50.4%
metadata-eval50.4%
Simplified50.4%
Taylor expanded in H around 0 94.9%
(FPCore (v H)
:precision binary64
(if (<= v -1.95e-178)
(atan -1.0)
(if (<= v 9.5e-148)
(atan (* -0.10204081632653061 (/ v (/ H v))))
(atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -1.95e-178) {
tmp = atan(-1.0);
} else if (v <= 9.5e-148) {
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 <= (-1.95d-178)) then
tmp = atan((-1.0d0))
else if (v <= 9.5d-148) 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 <= -1.95e-178) {
tmp = Math.atan(-1.0);
} else if (v <= 9.5e-148) {
tmp = Math.atan((-0.10204081632653061 * (v / (H / v))));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -1.95e-178: tmp = math.atan(-1.0) elif v <= 9.5e-148: 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 <= -1.95e-178) tmp = atan(-1.0); elseif (v <= 9.5e-148) 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 <= -1.95e-178) tmp = atan(-1.0); elseif (v <= 9.5e-148) tmp = atan((-0.10204081632653061 * (v / (H / v)))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -1.95e-178], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 9.5e-148], 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 -1.95 \cdot 10^{-178}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 9.5 \cdot 10^{-148}:\\
\;\;\;\;\tan^{-1} \left(-0.10204081632653061 \cdot \frac{v}{\frac{H}{v}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -1.95000000000000013e-178Initial program 67.0%
metadata-eval67.0%
Simplified67.0%
Taylor expanded in v around -inf 76.8%
if -1.95000000000000013e-178 < v < 9.50000000000000069e-148Initial program 99.8%
sqr-neg99.8%
sqr-neg99.8%
fmm-def99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in H around 0 41.3%
Taylor expanded in v around 0 41.3%
*-un-lft-identity41.3%
times-frac41.3%
metadata-eval41.3%
Applied egg-rr41.3%
if 9.50000000000000069e-148 < v Initial program 61.7%
metadata-eval61.7%
Simplified61.7%
Taylor expanded in v around inf 79.9%
(FPCore (v H) :precision binary64 (if (<= v -1.2e-178) (atan -1.0) (atan (/ v (+ v (* -9.8 (/ H v)))))))
double code(double v, double H) {
double tmp;
if (v <= -1.2e-178) {
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 <= (-1.2d-178)) 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 <= -1.2e-178) {
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 <= -1.2e-178: 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 <= -1.2e-178) 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 <= -1.2e-178) tmp = atan(-1.0); else tmp = atan((v / (v + (-9.8 * (H / v))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -1.2e-178], 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 -1.2 \cdot 10^{-178}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + -9.8 \cdot \frac{H}{v}}\right)\\
\end{array}
\end{array}
if v < -1.20000000000000002e-178Initial program 67.0%
metadata-eval67.0%
Simplified67.0%
Taylor expanded in v around -inf 76.8%
if -1.20000000000000002e-178 < v Initial program 70.8%
sqr-neg70.8%
sqr-neg70.8%
fmm-def70.8%
*-commutative70.8%
distribute-rgt-neg-in70.8%
metadata-eval70.8%
metadata-eval70.8%
Simplified70.8%
Taylor expanded in H around 0 71.4%
(FPCore (v H) :precision binary64 (if (<= v 1.7e-297) (atan -1.0) (atan 1.0)))
double code(double v, double H) {
double tmp;
if (v <= 1.7e-297) {
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 <= 1.7d-297) 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 <= 1.7e-297) {
tmp = Math.atan(-1.0);
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= 1.7e-297: tmp = math.atan(-1.0) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= 1.7e-297) tmp = atan(-1.0); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= 1.7e-297) tmp = atan(-1.0); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, 1.7e-297], N[ArcTan[-1.0], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq 1.7 \cdot 10^{-297}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < 1.69999999999999991e-297Initial program 72.2%
metadata-eval72.2%
Simplified72.2%
Taylor expanded in v around -inf 65.2%
if 1.69999999999999991e-297 < v Initial program 66.3%
metadata-eval66.3%
Simplified66.3%
Taylor expanded in v around inf 70.6%
(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 69.2%
metadata-eval69.2%
Simplified69.2%
Taylor expanded in v around -inf 33.0%
herbie shell --seed 2024188
(FPCore (v H)
:name "Optimal throwing angle"
:precision binary64
(atan (/ v (sqrt (- (* v v) (* (* 2.0 9.8) H))))))