
(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 10 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 5e+132)
(atan (* v (pow (+ (* v v) (* H -19.6)) -0.5)))
(atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -1e+154) {
tmp = atan(-1.0);
} else if (v <= 5e+132) {
tmp = atan((v * pow(((v * v) + (H * -19.6)), -0.5)));
} 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+132) then
tmp = atan((v * (((v * v) + (h * (-19.6d0))) ** (-0.5d0))))
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+132) {
tmp = Math.atan((v * Math.pow(((v * v) + (H * -19.6)), -0.5)));
} 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+132: tmp = math.atan((v * math.pow(((v * v) + (H * -19.6)), -0.5))) 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+132) tmp = atan(Float64(v * (Float64(Float64(v * v) + Float64(H * -19.6)) ^ -0.5))); 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+132) tmp = atan((v * (((v * v) + (H * -19.6)) ^ -0.5))); 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+132], N[ArcTan[N[(v * N[Power[N[(N[(v * v), $MachinePrecision] + 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 -1 \cdot 10^{+154}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 5 \cdot 10^{+132}:\\
\;\;\;\;\tan^{-1} \left(v \cdot {\left(v \cdot v + H \cdot -19.6\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -1.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 -1.00000000000000004e154 < v < 5.0000000000000001e132Initial 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
associate-/r/N/A
*-lowering-*.f64N/A
pow1/2N/A
pow-flipN/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-eval99.8%
Applied egg-rr99.8%
if 5.0000000000000001e132 < v Initial program 12.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-eval12.9%
Simplified12.9%
Taylor expanded in v around inf
Simplified100.0%
Final simplification99.9%
(FPCore (v H) :precision binary64 (if (<= v -1e+155) (atan -1.0) (if (<= v 2e+129) (atan (/ v (sqrt (+ (* v v) (* H -19.6))))) (atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -1e+155) {
tmp = atan(-1.0);
} else if (v <= 2e+129) {
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+155)) then
tmp = atan((-1.0d0))
else if (v <= 2d+129) 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+155) {
tmp = Math.atan(-1.0);
} else if (v <= 2e+129) {
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+155: tmp = math.atan(-1.0) elif v <= 2e+129: 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+155) tmp = atan(-1.0); elseif (v <= 2e+129) 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+155) tmp = atan(-1.0); elseif (v <= 2e+129) 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+155], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 2e+129], 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^{+155}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 2 \cdot 10^{+129}:\\
\;\;\;\;\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 < -1.00000000000000001e155Initial 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 -1.00000000000000001e155 < v < 2e129Initial 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%
if 2e129 < v Initial program 12.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-eval12.9%
Simplified12.9%
Taylor expanded in v around inf
Simplified100.0%
(FPCore (v H)
:precision binary64
(if (<= v -6e+31)
(atan (/ v (- (/ H (/ v 9.8)) v)))
(if (<= v 4.5e-46)
(atan (* v (pow (* H -19.6) -0.5)))
(atan (/ v (+ v (* -9.8 (/ H v))))))))
double code(double v, double H) {
double tmp;
if (v <= -6e+31) {
tmp = atan((v / ((H / (v / 9.8)) - v)));
} else if (v <= 4.5e-46) {
tmp = atan((v * pow((H * -19.6), -0.5)));
} 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 <= (-6d+31)) then
tmp = atan((v / ((h / (v / 9.8d0)) - v)))
else if (v <= 4.5d-46) then
tmp = atan((v * ((h * (-19.6d0)) ** (-0.5d0))))
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 <= -6e+31) {
tmp = Math.atan((v / ((H / (v / 9.8)) - v)));
} else if (v <= 4.5e-46) {
tmp = Math.atan((v * Math.pow((H * -19.6), -0.5)));
} else {
tmp = Math.atan((v / (v + (-9.8 * (H / v)))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -6e+31: tmp = math.atan((v / ((H / (v / 9.8)) - v))) elif v <= 4.5e-46: tmp = math.atan((v * math.pow((H * -19.6), -0.5))) else: tmp = math.atan((v / (v + (-9.8 * (H / v))))) return tmp
function code(v, H) tmp = 0.0 if (v <= -6e+31) tmp = atan(Float64(v / Float64(Float64(H / Float64(v / 9.8)) - v))); elseif (v <= 4.5e-46) tmp = atan(Float64(v * (Float64(H * -19.6) ^ -0.5))); 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 <= -6e+31) tmp = atan((v / ((H / (v / 9.8)) - v))); elseif (v <= 4.5e-46) tmp = atan((v * ((H * -19.6) ^ -0.5))); else tmp = atan((v / (v + (-9.8 * (H / v))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -6e+31], N[ArcTan[N[(v / N[(N[(H / N[(v / 9.8), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[v, 4.5e-46], N[ArcTan[N[(v * N[Power[N[(H * -19.6), $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 -6 \cdot 10^{+31}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\frac{H}{\frac{v}{9.8}} - v}\right)\\
\mathbf{elif}\;v \leq 4.5 \cdot 10^{-46}:\\
\;\;\;\;\tan^{-1} \left(v \cdot {\left(H \cdot -19.6\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.99999999999999978e31Initial program 43.4%
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-eval43.4%
Simplified43.4%
Taylor expanded in v around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified95.6%
sub0-negN/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
distribute-lft1-inN/A
unsub-negN/A
--lowering--.f64N/A
Applied egg-rr95.6%
if -5.99999999999999978e31 < v < 4.50000000000000001e-46Initial program 99.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-eval99.6%
Simplified99.6%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
pow1/2N/A
pow-flipN/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in v around 0
*-lowering-*.f6486.5%
Simplified86.5%
if 4.50000000000000001e-46 < v Initial program 50.4%
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-eval50.4%
Simplified50.4%
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
associate-*l/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6491.7%
Simplified91.7%
Final simplification90.4%
(FPCore (v H)
:precision binary64
(if (<= v -4.7e+17)
(atan (/ v (- (/ H (/ v 9.8)) v)))
(if (<= v 2e-47)
(atan (* v (sqrt (/ -0.05102040816326531 H))))
(atan (/ v (+ v (* -9.8 (/ H v))))))))
double code(double v, double H) {
double tmp;
if (v <= -4.7e+17) {
tmp = atan((v / ((H / (v / 9.8)) - v)));
} else if (v <= 2e-47) {
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 <= (-4.7d+17)) then
tmp = atan((v / ((h / (v / 9.8d0)) - v)))
else if (v <= 2d-47) 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 <= -4.7e+17) {
tmp = Math.atan((v / ((H / (v / 9.8)) - v)));
} else if (v <= 2e-47) {
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 <= -4.7e+17: tmp = math.atan((v / ((H / (v / 9.8)) - v))) elif v <= 2e-47: 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 <= -4.7e+17) tmp = atan(Float64(v / Float64(Float64(H / Float64(v / 9.8)) - v))); elseif (v <= 2e-47) 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 <= -4.7e+17) tmp = atan((v / ((H / (v / 9.8)) - v))); elseif (v <= 2e-47) 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, -4.7e+17], N[ArcTan[N[(v / N[(N[(H / N[(v / 9.8), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[v, 2e-47], 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 -4.7 \cdot 10^{+17}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\frac{H}{\frac{v}{9.8}} - v}\right)\\
\mathbf{elif}\;v \leq 2 \cdot 10^{-47}:\\
\;\;\;\;\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 < -4.7e17Initial program 47.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-eval47.0%
Simplified47.0%
Taylor expanded in v around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified93.0%
sub0-negN/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
distribute-lft1-inN/A
unsub-negN/A
--lowering--.f64N/A
Applied egg-rr93.0%
if -4.7e17 < v < 1.9999999999999999e-47Initial program 99.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-eval99.6%
Simplified99.6%
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.6%
Simplified99.6%
Taylor expanded in H around inf
/-lowering-/.f6487.8%
Simplified87.8%
if 1.9999999999999999e-47 < v Initial program 50.4%
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-eval50.4%
Simplified50.4%
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
associate-*l/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6491.7%
Simplified91.7%
(FPCore (v H) :precision binary64 (if (<= v -6.5e-182) (atan -1.0) (if (<= v 1.9e-135) (atan (/ 1.0 (/ (/ (* H -9.8) v) v))) (atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -6.5e-182) {
tmp = atan(-1.0);
} else if (v <= 1.9e-135) {
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 <= (-6.5d-182)) then
tmp = atan((-1.0d0))
else if (v <= 1.9d-135) 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 <= -6.5e-182) {
tmp = Math.atan(-1.0);
} else if (v <= 1.9e-135) {
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 <= -6.5e-182: tmp = math.atan(-1.0) elif v <= 1.9e-135: 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 <= -6.5e-182) tmp = atan(-1.0); elseif (v <= 1.9e-135) 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 <= -6.5e-182) tmp = atan(-1.0); elseif (v <= 1.9e-135) 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, -6.5e-182], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 1.9e-135], 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 -6.5 \cdot 10^{-182}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 1.9 \cdot 10^{-135}:\\
\;\;\;\;\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 < -6.49999999999999997e-182Initial program 66.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-eval66.6%
Simplified66.6%
Taylor expanded in v around -inf
Simplified69.3%
if -6.49999999999999997e-182 < v < 1.9000000000000001e-135Initial program 99.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-eval99.5%
Simplified99.5%
Taylor expanded in v around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
*-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
associate-*l/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6426.9%
Simplified26.9%
Taylor expanded in v around 0
atan-lowering-atan.f64N/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-*.f6426.9%
Simplified26.9%
Taylor expanded in H around inf
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-*.f6426.9%
Simplified26.9%
if 1.9000000000000001e-135 < v Initial program 57.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-eval57.3%
Simplified57.3%
Taylor expanded in v around inf
Simplified83.3%
(FPCore (v H)
:precision binary64
(if (<= v -7e-182)
(atan -1.0)
(if (<= v 6.2e-137)
(atan (* (/ v (/ H v)) -0.10204081632653061))
(atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -7e-182) {
tmp = atan(-1.0);
} else if (v <= 6.2e-137) {
tmp = atan(((v / (H / v)) * -0.10204081632653061));
} 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 <= (-7d-182)) then
tmp = atan((-1.0d0))
else if (v <= 6.2d-137) then
tmp = atan(((v / (h / v)) * (-0.10204081632653061d0)))
else
tmp = atan(1.0d0)
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -7e-182) {
tmp = Math.atan(-1.0);
} else if (v <= 6.2e-137) {
tmp = Math.atan(((v / (H / v)) * -0.10204081632653061));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -7e-182: tmp = math.atan(-1.0) elif v <= 6.2e-137: tmp = math.atan(((v / (H / v)) * -0.10204081632653061)) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -7e-182) tmp = atan(-1.0); elseif (v <= 6.2e-137) tmp = atan(Float64(Float64(v / Float64(H / v)) * -0.10204081632653061)); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -7e-182) tmp = atan(-1.0); elseif (v <= 6.2e-137) tmp = atan(((v / (H / v)) * -0.10204081632653061)); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -7e-182], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 6.2e-137], N[ArcTan[N[(N[(v / N[(H / v), $MachinePrecision]), $MachinePrecision] * -0.10204081632653061), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -7 \cdot 10^{-182}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 6.2 \cdot 10^{-137}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\frac{H}{v}} \cdot -0.10204081632653061\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -6.99999999999999966e-182Initial program 66.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-eval66.6%
Simplified66.6%
Taylor expanded in v around -inf
Simplified69.3%
if -6.99999999999999966e-182 < v < 6.19999999999999955e-137Initial program 99.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-eval99.5%
Simplified99.5%
Taylor expanded in v around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
*-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
associate-*l/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6426.9%
Simplified26.9%
Taylor expanded in v around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6426.9%
Simplified26.9%
div-invN/A
clear-numN/A
associate-/r*N/A
div-invN/A
associate-*r*N/A
*-lowering-*.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval26.9%
Applied egg-rr26.9%
if 6.19999999999999955e-137 < v Initial program 57.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-eval57.3%
Simplified57.3%
Taylor expanded in v around inf
Simplified83.3%
(FPCore (v H) :precision binary64 (if (<= v -2e-266) (atan (/ v (- (/ H (/ v 9.8)) v))) (atan (/ v (+ v (* -9.8 (/ H v)))))))
double code(double v, double H) {
double tmp;
if (v <= -2e-266) {
tmp = atan((v / ((H / (v / 9.8)) - 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 <= (-2d-266)) then
tmp = atan((v / ((h / (v / 9.8d0)) - 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 <= -2e-266) {
tmp = Math.atan((v / ((H / (v / 9.8)) - v)));
} else {
tmp = Math.atan((v / (v + (-9.8 * (H / v)))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -2e-266: tmp = math.atan((v / ((H / (v / 9.8)) - v))) else: tmp = math.atan((v / (v + (-9.8 * (H / v))))) return tmp
function code(v, H) tmp = 0.0 if (v <= -2e-266) tmp = atan(Float64(v / Float64(Float64(H / Float64(v / 9.8)) - 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 <= -2e-266) tmp = atan((v / ((H / (v / 9.8)) - v))); else tmp = atan((v / (v + (-9.8 * (H / v))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -2e-266], N[ArcTan[N[(v / N[(N[(H / N[(v / 9.8), $MachinePrecision]), $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 -2 \cdot 10^{-266}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\frac{H}{\frac{v}{9.8}} - v}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + -9.8 \cdot \frac{H}{v}}\right)\\
\end{array}
\end{array}
if v < -2e-266Initial program 70.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-eval70.9%
Simplified70.9%
Taylor expanded in v around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified63.9%
sub0-negN/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
distribute-lft1-inN/A
unsub-negN/A
--lowering--.f64N/A
Applied egg-rr63.9%
if -2e-266 < v Initial program 69.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-eval69.1%
Simplified69.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
associate-*l/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6467.8%
Simplified67.8%
(FPCore (v H) :precision binary64 (if (<= v -7.5e-182) (atan -1.0) (atan (/ v (+ v (* -9.8 (/ H v)))))))
double code(double v, double H) {
double tmp;
if (v <= -7.5e-182) {
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 <= (-7.5d-182)) 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 <= -7.5e-182) {
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 <= -7.5e-182: 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 <= -7.5e-182) 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 <= -7.5e-182) tmp = atan(-1.0); else tmp = atan((v / (v + (-9.8 * (H / v))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -7.5e-182], 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.5 \cdot 10^{-182}:\\
\;\;\;\;\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.49999999999999935e-182Initial program 66.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-eval66.6%
Simplified66.6%
Taylor expanded in v around -inf
Simplified69.3%
if -7.49999999999999935e-182 < v Initial program 72.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-eval72.1%
Simplified72.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
associate-*l/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6463.6%
Simplified63.6%
(FPCore (v H) :precision binary64 (if (<= v -1.05e-303) (atan -1.0) (atan 1.0)))
double code(double v, double H) {
double tmp;
if (v <= -1.05e-303) {
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.05d-303)) 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.05e-303) {
tmp = Math.atan(-1.0);
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -1.05e-303: tmp = math.atan(-1.0) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -1.05e-303) 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.05e-303) tmp = atan(-1.0); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -1.05e-303], N[ArcTan[-1.0], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -1.05 \cdot 10^{-303}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -1.05e-303Initial program 72.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-eval72.3%
Simplified72.3%
Taylor expanded in v around -inf
Simplified58.1%
if -1.05e-303 < v Initial program 67.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-eval67.7%
Simplified67.7%
Taylor expanded in v around inf
Simplified63.8%
(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.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-eval69.9%
Simplified69.9%
Taylor expanded in v around -inf
Simplified28.9%
herbie shell --seed 2024164
(FPCore (v H)
:name "Optimal throwing angle"
:precision binary64
(atan (/ v (sqrt (- (* v v) (* (* 2.0 9.8) H))))))