
(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+155) (atan -1.0) (if (<= v 1.9e+49) (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 <= 1.9e+49) {
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 <= 1.9d+49) 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 <= 1.9e+49) {
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 <= 1.9e+49: 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 <= 1.9e+49) 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 <= 1.9e+49) 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, 1.9e+49], 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 1.9 \cdot 10^{+49}:\\
\;\;\;\;\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 < 1.8999999999999999e49Initial 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 1.8999999999999999e49 < v Initial program 36.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-eval36.9%
Simplified36.9%
Taylor expanded in v around inf
Simplified100.0%
(FPCore (v H)
:precision binary64
(if (<= v -6.2e-39)
(atan (/ v (- (* 9.8 (/ H v)) v)))
(if (<= v 1.55e-80)
(atan (* v (pow (/ H -0.05102040816326531) -0.5)))
(atan (/ v (+ v (/ (* H -9.8) v)))))))
double code(double v, double H) {
double tmp;
if (v <= -6.2e-39) {
tmp = atan((v / ((9.8 * (H / v)) - v)));
} else if (v <= 1.55e-80) {
tmp = atan((v * pow((H / -0.05102040816326531), -0.5)));
} else {
tmp = atan((v / (v + ((H * -9.8) / 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.2d-39)) then
tmp = atan((v / ((9.8d0 * (h / v)) - v)))
else if (v <= 1.55d-80) then
tmp = atan((v * ((h / (-0.05102040816326531d0)) ** (-0.5d0))))
else
tmp = atan((v / (v + ((h * (-9.8d0)) / v))))
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -6.2e-39) {
tmp = Math.atan((v / ((9.8 * (H / v)) - v)));
} else if (v <= 1.55e-80) {
tmp = Math.atan((v * Math.pow((H / -0.05102040816326531), -0.5)));
} else {
tmp = Math.atan((v / (v + ((H * -9.8) / v))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -6.2e-39: tmp = math.atan((v / ((9.8 * (H / v)) - v))) elif v <= 1.55e-80: tmp = math.atan((v * math.pow((H / -0.05102040816326531), -0.5))) else: tmp = math.atan((v / (v + ((H * -9.8) / v)))) return tmp
function code(v, H) tmp = 0.0 if (v <= -6.2e-39) tmp = atan(Float64(v / Float64(Float64(9.8 * Float64(H / v)) - v))); elseif (v <= 1.55e-80) tmp = atan(Float64(v * (Float64(H / -0.05102040816326531) ^ -0.5))); else tmp = atan(Float64(v / Float64(v + Float64(Float64(H * -9.8) / v)))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -6.2e-39) tmp = atan((v / ((9.8 * (H / v)) - v))); elseif (v <= 1.55e-80) tmp = atan((v * ((H / -0.05102040816326531) ^ -0.5))); else tmp = atan((v / (v + ((H * -9.8) / v)))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -6.2e-39], N[ArcTan[N[(v / N[(N[(9.8 * N[(H / v), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[v, 1.55e-80], N[ArcTan[N[(v * N[Power[N[(H / -0.05102040816326531), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(v / N[(v + N[(N[(H * -9.8), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -6.2 \cdot 10^{-39}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{9.8 \cdot \frac{H}{v} - v}\right)\\
\mathbf{elif}\;v \leq 1.55 \cdot 10^{-80}:\\
\;\;\;\;\tan^{-1} \left(v \cdot {\left(\frac{H}{-0.05102040816326531}\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + \frac{H \cdot -9.8}{v}}\right)\\
\end{array}
\end{array}
if v < -6.1999999999999994e-39Initial program 49.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-eval49.2%
Simplified49.2%
Taylor expanded in v around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified78.6%
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
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6493.5%
Simplified93.5%
if -6.1999999999999994e-39 < v < 1.55000000000000008e-80Initial 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%
pow1/2N/A
flip-+N/A
fmm-defN/A
*-commutativeN/A
clear-numN/A
inv-powN/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
Applied egg-rr99.5%
Taylor expanded in v around 0
/-lowering-/.f6492.1%
Simplified92.1%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
pow-flipN/A
clear-numN/A
inv-powN/A
div-invN/A
metadata-evalN/A
pow-powN/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
metadata-evalN/A
div-invN/A
/-lowering-/.f6492.1%
Applied egg-rr92.1%
if 1.55000000000000008e-80 < v Initial program 55.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-eval55.6%
Simplified55.6%
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-*.f6490.9%
Simplified90.9%
Final simplification92.1%
(FPCore (v H)
:precision binary64
(if (<= v -2.95e-38)
(atan (/ v (- (* 9.8 (/ H v)) v)))
(if (<= v 1.3e-77)
(atan (/ v (sqrt (* H -19.6))))
(atan (/ v (+ v (/ (* H -9.8) v)))))))
double code(double v, double H) {
double tmp;
if (v <= -2.95e-38) {
tmp = atan((v / ((9.8 * (H / v)) - v)));
} else if (v <= 1.3e-77) {
tmp = atan((v / sqrt((H * -19.6))));
} else {
tmp = atan((v / (v + ((H * -9.8) / 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.95d-38)) then
tmp = atan((v / ((9.8d0 * (h / v)) - v)))
else if (v <= 1.3d-77) then
tmp = atan((v / sqrt((h * (-19.6d0)))))
else
tmp = atan((v / (v + ((h * (-9.8d0)) / v))))
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -2.95e-38) {
tmp = Math.atan((v / ((9.8 * (H / v)) - v)));
} else if (v <= 1.3e-77) {
tmp = Math.atan((v / Math.sqrt((H * -19.6))));
} else {
tmp = Math.atan((v / (v + ((H * -9.8) / v))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -2.95e-38: tmp = math.atan((v / ((9.8 * (H / v)) - v))) elif v <= 1.3e-77: tmp = math.atan((v / math.sqrt((H * -19.6)))) else: tmp = math.atan((v / (v + ((H * -9.8) / v)))) return tmp
function code(v, H) tmp = 0.0 if (v <= -2.95e-38) tmp = atan(Float64(v / Float64(Float64(9.8 * Float64(H / v)) - v))); elseif (v <= 1.3e-77) tmp = atan(Float64(v / sqrt(Float64(H * -19.6)))); else tmp = atan(Float64(v / Float64(v + Float64(Float64(H * -9.8) / v)))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -2.95e-38) tmp = atan((v / ((9.8 * (H / v)) - v))); elseif (v <= 1.3e-77) tmp = atan((v / sqrt((H * -19.6)))); else tmp = atan((v / (v + ((H * -9.8) / v)))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -2.95e-38], N[ArcTan[N[(v / N[(N[(9.8 * N[(H / v), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[v, 1.3e-77], N[ArcTan[N[(v / N[Sqrt[N[(H * -19.6), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(v / N[(v + N[(N[(H * -9.8), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2.95 \cdot 10^{-38}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{9.8 \cdot \frac{H}{v} - v}\right)\\
\mathbf{elif}\;v \leq 1.3 \cdot 10^{-77}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\sqrt{H \cdot -19.6}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + \frac{H \cdot -9.8}{v}}\right)\\
\end{array}
\end{array}
if v < -2.94999999999999991e-38Initial program 49.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-eval49.2%
Simplified49.2%
Taylor expanded in v around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified78.6%
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
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6493.5%
Simplified93.5%
if -2.94999999999999991e-38 < v < 1.3000000000000001e-77Initial 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 0
*-lowering-*.f6492.0%
Simplified92.0%
if 1.3000000000000001e-77 < v Initial program 55.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-eval55.6%
Simplified55.6%
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-*.f6490.9%
Simplified90.9%
Final simplification92.1%
(FPCore (v H)
:precision binary64
(if (<= v -2e-146)
(atan -1.0)
(if (<= v 1.4e-104)
(atan (* (/ v H) (* v -0.10204081632653061)))
(atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -2e-146) {
tmp = atan(-1.0);
} else if (v <= 1.4e-104) {
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 <= (-2d-146)) then
tmp = atan((-1.0d0))
else if (v <= 1.4d-104) 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 <= -2e-146) {
tmp = Math.atan(-1.0);
} else if (v <= 1.4e-104) {
tmp = Math.atan(((v / H) * (v * -0.10204081632653061)));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -2e-146: tmp = math.atan(-1.0) elif v <= 1.4e-104: 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 <= -2e-146) tmp = atan(-1.0); elseif (v <= 1.4e-104) tmp = atan(Float64(Float64(v / H) * Float64(v * -0.10204081632653061))); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -2e-146) tmp = atan(-1.0); elseif (v <= 1.4e-104) tmp = atan(((v / H) * (v * -0.10204081632653061))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -2e-146], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 1.4e-104], N[ArcTan[N[(N[(v / H), $MachinePrecision] * N[(v * -0.10204081632653061), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2 \cdot 10^{-146}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 1.4 \cdot 10^{-104}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{H} \cdot \left(v \cdot -0.10204081632653061\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -2.00000000000000005e-146Initial 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%
Taylor expanded in v around -inf
Simplified79.8%
if -2.00000000000000005e-146 < v < 1.4e-104Initial 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
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6425.7%
Simplified25.7%
Taylor expanded in H around -inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
/-lowering-/.f64N/A
Simplified25.7%
neg-mul-1N/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
*-commutativeN/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
Applied egg-rr25.8%
Taylor expanded in v around 0
*-commutativeN/A
*-lowering-*.f6425.8%
Simplified25.8%
if 1.4e-104 < v Initial program 57.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-eval57.4%
Simplified57.4%
Taylor expanded in v around inf
Simplified88.0%
(FPCore (v H) :precision binary64 (if (<= v 2e-273) (atan (/ v (- (* 9.8 (/ H v)) v))) (atan (/ v (+ v (/ (* H -9.8) v))))))
double code(double v, double H) {
double tmp;
if (v <= 2e-273) {
tmp = atan((v / ((9.8 * (H / v)) - v)));
} else {
tmp = atan((v / (v + ((H * -9.8) / 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-273) then
tmp = atan((v / ((9.8d0 * (h / v)) - v)))
else
tmp = atan((v / (v + ((h * (-9.8d0)) / v))))
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= 2e-273) {
tmp = Math.atan((v / ((9.8 * (H / v)) - v)));
} else {
tmp = Math.atan((v / (v + ((H * -9.8) / v))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= 2e-273: tmp = math.atan((v / ((9.8 * (H / v)) - v))) else: tmp = math.atan((v / (v + ((H * -9.8) / v)))) return tmp
function code(v, H) tmp = 0.0 if (v <= 2e-273) tmp = atan(Float64(v / Float64(Float64(9.8 * Float64(H / v)) - v))); else tmp = atan(Float64(v / Float64(v + Float64(Float64(H * -9.8) / v)))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= 2e-273) tmp = atan((v / ((9.8 * (H / v)) - v))); else tmp = atan((v / (v + ((H * -9.8) / v)))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, 2e-273], N[ArcTan[N[(v / N[(N[(9.8 * N[(H / v), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(v / N[(v + N[(N[(H * -9.8), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq 2 \cdot 10^{-273}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{9.8 \cdot \frac{H}{v} - v}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + \frac{H \cdot -9.8}{v}}\right)\\
\end{array}
\end{array}
if v < 2e-273Initial program 69.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-eval69.4%
Simplified69.4%
Taylor expanded in v around -inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified48.0%
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
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6469.6%
Simplified69.6%
if 2e-273 < v Initial program 64.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-eval64.8%
Simplified64.8%
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-*.f6473.9%
Simplified73.9%
(FPCore (v H) :precision binary64 (if (<= v -2.35e-147) (atan -1.0) (atan (/ v (+ v (/ (* H -9.8) v))))))
double code(double v, double H) {
double tmp;
if (v <= -2.35e-147) {
tmp = atan(-1.0);
} else {
tmp = atan((v / (v + ((H * -9.8) / 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.35d-147)) then
tmp = atan((-1.0d0))
else
tmp = atan((v / (v + ((h * (-9.8d0)) / v))))
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -2.35e-147) {
tmp = Math.atan(-1.0);
} else {
tmp = Math.atan((v / (v + ((H * -9.8) / v))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -2.35e-147: tmp = math.atan(-1.0) else: tmp = math.atan((v / (v + ((H * -9.8) / v)))) return tmp
function code(v, H) tmp = 0.0 if (v <= -2.35e-147) tmp = atan(-1.0); else tmp = atan(Float64(v / Float64(v + Float64(Float64(H * -9.8) / v)))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -2.35e-147) tmp = atan(-1.0); else tmp = atan((v / (v + ((H * -9.8) / v)))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -2.35e-147], N[ArcTan[-1.0], $MachinePrecision], N[ArcTan[N[(v / N[(v + N[(N[(H * -9.8), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2.35 \cdot 10^{-147}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + \frac{H \cdot -9.8}{v}}\right)\\
\end{array}
\end{array}
if v < -2.34999999999999994e-147Initial 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%
Taylor expanded in v around -inf
Simplified79.8%
if -2.34999999999999994e-147 < v Initial program 72.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-eval72.7%
Simplified72.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-*.f6465.6%
Simplified65.6%
(FPCore (v H) :precision binary64 (if (<= v -1.15e-303) (atan -1.0) (atan 1.0)))
double code(double v, double H) {
double tmp;
if (v <= -1.15e-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.15d-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.15e-303) {
tmp = Math.atan(-1.0);
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -1.15e-303: tmp = math.atan(-1.0) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -1.15e-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.15e-303) tmp = atan(-1.0); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -1.15e-303], N[ArcTan[-1.0], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -1.15 \cdot 10^{-303}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -1.14999999999999998e-303Initial program 67.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-eval67.3%
Simplified67.3%
Taylor expanded in v around -inf
Simplified64.3%
if -1.14999999999999998e-303 < v Initial program 67.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-eval67.2%
Simplified67.2%
Taylor expanded in v around inf
Simplified68.5%
(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 67.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-eval67.3%
Simplified67.3%
Taylor expanded in v around -inf
Simplified33.1%
herbie shell --seed 2024138
(FPCore (v H)
:name "Optimal throwing angle"
:precision binary64
(atan (/ v (sqrt (- (* v v) (* (* 2.0 9.8) H))))))