
(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 -5e+154)
(atan -1.0)
(if (<= v 9e+120)
(atan (* v (pow (fma H -19.6 (* v v)) -0.5)))
(atan (/ v (+ v (* -9.8 (/ H v))))))))
double code(double v, double H) {
double tmp;
if (v <= -5e+154) {
tmp = atan(-1.0);
} else if (v <= 9e+120) {
tmp = atan((v * pow(fma(H, -19.6, (v * v)), -0.5)));
} else {
tmp = atan((v / (v + (-9.8 * (H / v)))));
}
return tmp;
}
function code(v, H) tmp = 0.0 if (v <= -5e+154) tmp = atan(-1.0); elseif (v <= 9e+120) tmp = atan(Float64(v * (fma(H, -19.6, Float64(v * v)) ^ -0.5))); else tmp = atan(Float64(v / Float64(v + Float64(-9.8 * Float64(H / v))))); end return tmp end
code[v_, H_] := If[LessEqual[v, -5e+154], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 9e+120], N[ArcTan[N[(v * N[Power[N[(H * -19.6 + N[(v * v), $MachinePrecision]), $MachinePrecision], -0.5], $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 -5 \cdot 10^{+154}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 9 \cdot 10^{+120}:\\
\;\;\;\;\tan^{-1} \left(v \cdot {\left(\mathsf{fma}\left(H, -19.6, v \cdot v\right)\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + -9.8 \cdot \frac{H}{v}}\right)\\
\end{array}
\end{array}
if v < -5.00000000000000004e154Initial program 3.1%
sqr-neg3.1%
sqr-neg3.1%
metadata-eval3.1%
Simplified3.1%
Taylor expanded in v around -inf 100.0%
if -5.00000000000000004e154 < v < 8.99999999999999953e120Initial program 99.7%
sqr-neg99.7%
sqr-neg99.7%
metadata-eval99.7%
Simplified99.7%
clear-num99.6%
associate-/r/99.7%
pow1/299.7%
pow-flip99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
metadata-eval99.8%
pow299.8%
metadata-eval99.8%
Applied egg-rr99.8%
pow299.8%
Applied egg-rr99.8%
if 8.99999999999999953e120 < v Initial program 24.0%
sqr-neg24.0%
sqr-neg24.0%
metadata-eval24.0%
Simplified24.0%
Taylor expanded in H around 0 98.8%
Final simplification99.6%
(FPCore (v H)
:precision binary64
(if (<= v -5e+154)
(atan -1.0)
(if (<= v 8e+120)
(atan (/ v (sqrt (- (* v v) (* H 19.6)))))
(atan (/ v (+ v (* -9.8 (/ H v))))))))
double code(double v, double H) {
double tmp;
if (v <= -5e+154) {
tmp = atan(-1.0);
} else if (v <= 8e+120) {
tmp = atan((v / sqrt(((v * v) - (H * 19.6)))));
} 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 <= (-5d+154)) then
tmp = atan((-1.0d0))
else if (v <= 8d+120) then
tmp = atan((v / sqrt(((v * v) - (h * 19.6d0)))))
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 <= -5e+154) {
tmp = Math.atan(-1.0);
} else if (v <= 8e+120) {
tmp = Math.atan((v / Math.sqrt(((v * v) - (H * 19.6)))));
} else {
tmp = Math.atan((v / (v + (-9.8 * (H / v)))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -5e+154: tmp = math.atan(-1.0) elif v <= 8e+120: tmp = math.atan((v / math.sqrt(((v * v) - (H * 19.6))))) else: tmp = math.atan((v / (v + (-9.8 * (H / v))))) return tmp
function code(v, H) tmp = 0.0 if (v <= -5e+154) tmp = atan(-1.0); elseif (v <= 8e+120) tmp = atan(Float64(v / sqrt(Float64(Float64(v * v) - Float64(H * 19.6))))); 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 <= -5e+154) tmp = atan(-1.0); elseif (v <= 8e+120) tmp = atan((v / sqrt(((v * v) - (H * 19.6))))); else tmp = atan((v / (v + (-9.8 * (H / v))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -5e+154], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 8e+120], N[ArcTan[N[(v / N[Sqrt[N[(N[(v * v), $MachinePrecision] - N[(H * 19.6), $MachinePrecision]), $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 -5 \cdot 10^{+154}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 8 \cdot 10^{+120}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - H \cdot 19.6}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + -9.8 \cdot \frac{H}{v}}\right)\\
\end{array}
\end{array}
if v < -5.00000000000000004e154Initial program 3.1%
sqr-neg3.1%
sqr-neg3.1%
metadata-eval3.1%
Simplified3.1%
Taylor expanded in v around -inf 100.0%
if -5.00000000000000004e154 < v < 7.9999999999999998e120Initial program 99.7%
sqr-neg99.7%
sqr-neg99.7%
metadata-eval99.7%
Simplified99.7%
if 7.9999999999999998e120 < v Initial program 24.0%
sqr-neg24.0%
sqr-neg24.0%
metadata-eval24.0%
Simplified24.0%
Taylor expanded in H around 0 98.8%
Final simplification99.5%
(FPCore (v H)
:precision binary64
(if (<= v -6.8e-48)
(atan (+ -1.0 (* -9.8 (/ H (pow v 2.0)))))
(if (<= v 4e-45)
(atan (* v (sqrt (/ -0.05102040816326531 H))))
(atan (/ v (+ v (* -9.8 (/ H v))))))))
double code(double v, double H) {
double tmp;
if (v <= -6.8e-48) {
tmp = atan((-1.0 + (-9.8 * (H / pow(v, 2.0)))));
} else if (v <= 4e-45) {
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 <= (-6.8d-48)) then
tmp = atan(((-1.0d0) + ((-9.8d0) * (h / (v ** 2.0d0)))))
else if (v <= 4d-45) 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 <= -6.8e-48) {
tmp = Math.atan((-1.0 + (-9.8 * (H / Math.pow(v, 2.0)))));
} else if (v <= 4e-45) {
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 <= -6.8e-48: tmp = math.atan((-1.0 + (-9.8 * (H / math.pow(v, 2.0))))) elif v <= 4e-45: 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 <= -6.8e-48) tmp = atan(Float64(-1.0 + Float64(-9.8 * Float64(H / (v ^ 2.0))))); elseif (v <= 4e-45) 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 <= -6.8e-48) tmp = atan((-1.0 + (-9.8 * (H / (v ^ 2.0))))); elseif (v <= 4e-45) 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, -6.8e-48], N[ArcTan[N[(-1.0 + N[(-9.8 * N[(H / N[Power[v, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[v, 4e-45], 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 -6.8 \cdot 10^{-48}:\\
\;\;\;\;\tan^{-1} \left(-1 + -9.8 \cdot \frac{H}{{v}^{2}}\right)\\
\mathbf{elif}\;v \leq 4 \cdot 10^{-45}:\\
\;\;\;\;\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 < -6.80000000000000056e-48Initial program 56.5%
sqr-neg56.5%
sqr-neg56.5%
metadata-eval56.5%
Simplified56.5%
Taylor expanded in v around -inf 93.8%
if -6.80000000000000056e-48 < v < 3.99999999999999994e-45Initial program 99.5%
sqr-neg99.5%
sqr-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in v around 0 99.7%
Taylor expanded in v around 0 91.0%
if 3.99999999999999994e-45 < v Initial program 50.6%
sqr-neg50.6%
sqr-neg50.6%
metadata-eval50.6%
Simplified50.6%
Taylor expanded in H around 0 92.9%
Final simplification92.7%
(FPCore (v H)
:precision binary64
(if (<= v -1.5e-58)
(atan -1.0)
(if (<= v 4.4e-41)
(atan (* v (sqrt (/ -0.05102040816326531 H))))
(atan (/ v (+ v (* -9.8 (/ H v))))))))
double code(double v, double H) {
double tmp;
if (v <= -1.5e-58) {
tmp = atan(-1.0);
} else if (v <= 4.4e-41) {
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 <= (-1.5d-58)) then
tmp = atan((-1.0d0))
else if (v <= 4.4d-41) 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 <= -1.5e-58) {
tmp = Math.atan(-1.0);
} else if (v <= 4.4e-41) {
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 <= -1.5e-58: tmp = math.atan(-1.0) elif v <= 4.4e-41: 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 <= -1.5e-58) tmp = atan(-1.0); elseif (v <= 4.4e-41) 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 <= -1.5e-58) tmp = atan(-1.0); elseif (v <= 4.4e-41) 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, -1.5e-58], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 4.4e-41], 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 -1.5 \cdot 10^{-58}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 4.4 \cdot 10^{-41}:\\
\;\;\;\;\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 < -1.50000000000000004e-58Initial program 56.5%
sqr-neg56.5%
sqr-neg56.5%
metadata-eval56.5%
Simplified56.5%
Taylor expanded in v around -inf 93.6%
if -1.50000000000000004e-58 < v < 4.4e-41Initial program 99.5%
sqr-neg99.5%
sqr-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in v around 0 99.7%
Taylor expanded in v around 0 91.0%
if 4.4e-41 < v Initial program 50.6%
sqr-neg50.6%
sqr-neg50.6%
metadata-eval50.6%
Simplified50.6%
Taylor expanded in H around 0 92.9%
(FPCore (v H) :precision binary64 (if (<= v -1.7e-127) (atan -1.0) (if (<= v 7e-146) (atan (/ v (* -9.8 (/ H v)))) (atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -1.7e-127) {
tmp = atan(-1.0);
} else if (v <= 7e-146) {
tmp = atan((v / (-9.8 * (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.7d-127)) then
tmp = atan((-1.0d0))
else if (v <= 7d-146) then
tmp = atan((v / ((-9.8d0) * (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.7e-127) {
tmp = Math.atan(-1.0);
} else if (v <= 7e-146) {
tmp = Math.atan((v / (-9.8 * (H / v))));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -1.7e-127: tmp = math.atan(-1.0) elif v <= 7e-146: tmp = math.atan((v / (-9.8 * (H / v)))) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -1.7e-127) tmp = atan(-1.0); elseif (v <= 7e-146) tmp = atan(Float64(v / Float64(-9.8 * Float64(H / v)))); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -1.7e-127) tmp = atan(-1.0); elseif (v <= 7e-146) tmp = atan((v / (-9.8 * (H / v)))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -1.7e-127], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 7e-146], N[ArcTan[N[(v / N[(-9.8 * N[(H / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -1.7 \cdot 10^{-127}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 7 \cdot 10^{-146}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{-9.8 \cdot \frac{H}{v}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -1.6999999999999999e-127Initial program 60.1%
sqr-neg60.1%
sqr-neg60.1%
metadata-eval60.1%
Simplified60.1%
Taylor expanded in v around -inf 88.1%
if -1.6999999999999999e-127 < v < 7.0000000000000003e-146Initial program 99.6%
sqr-neg99.6%
sqr-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in H around 0 26.3%
Taylor expanded in v around 0 26.3%
if 7.0000000000000003e-146 < v Initial program 58.7%
sqr-neg58.7%
sqr-neg58.7%
metadata-eval58.7%
Simplified58.7%
Taylor expanded in v around inf 81.8%
(FPCore (v H) :precision binary64 (if (<= v -1.7e-127) (atan -1.0) (atan (/ v (+ v (* -9.8 (/ H v)))))))
double code(double v, double H) {
double tmp;
if (v <= -1.7e-127) {
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.7d-127)) 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.7e-127) {
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.7e-127: 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.7e-127) 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.7e-127) 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.7e-127], 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.7 \cdot 10^{-127}:\\
\;\;\;\;\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.6999999999999999e-127Initial program 60.1%
sqr-neg60.1%
sqr-neg60.1%
metadata-eval60.1%
Simplified60.1%
Taylor expanded in v around -inf 88.1%
if -1.6999999999999999e-127 < v Initial program 69.1%
sqr-neg69.1%
sqr-neg69.1%
metadata-eval69.1%
Simplified69.1%
Taylor expanded in H around 0 68.1%
(FPCore (v H) :precision binary64 (if (<= v -2.4e-308) (atan -1.0) (atan 1.0)))
double code(double v, double H) {
double tmp;
if (v <= -2.4e-308) {
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.4d-308)) 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.4e-308) {
tmp = Math.atan(-1.0);
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -2.4e-308: tmp = math.atan(-1.0) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -2.4e-308) 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.4e-308) tmp = atan(-1.0); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -2.4e-308], N[ArcTan[-1.0], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2.4 \cdot 10^{-308}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -2.40000000000000008e-308Initial program 65.8%
sqr-neg65.8%
sqr-neg65.8%
metadata-eval65.8%
Simplified65.8%
Taylor expanded in v around -inf 76.1%
if -2.40000000000000008e-308 < v Initial program 65.8%
sqr-neg65.8%
sqr-neg65.8%
metadata-eval65.8%
Simplified65.8%
Taylor expanded in v around inf 68.4%
(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.8%
sqr-neg65.8%
sqr-neg65.8%
metadata-eval65.8%
Simplified65.8%
Taylor expanded in v around -inf 34.0%
herbie shell --seed 2024180
(FPCore (v H)
:name "Optimal throwing angle"
:precision binary64
(atan (/ v (sqrt (- (* v v) (* (* 2.0 9.8) H))))))