
(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 11 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 1e+127)
(atan (* v (pow (+ (* v v) (* H -19.6)) -0.5)))
(atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -5e+154) {
tmp = atan(-1.0);
} else if (v <= 1e+127) {
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 <= (-5d+154)) then
tmp = atan((-1.0d0))
else if (v <= 1d+127) 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 <= -5e+154) {
tmp = Math.atan(-1.0);
} else if (v <= 1e+127) {
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 <= -5e+154: tmp = math.atan(-1.0) elif v <= 1e+127: 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 <= -5e+154) tmp = atan(-1.0); elseif (v <= 1e+127) 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 <= -5e+154) tmp = atan(-1.0); elseif (v <= 1e+127) 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, -5e+154], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 1e+127], 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 -5 \cdot 10^{+154}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 10^{+127}:\\
\;\;\;\;\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 < -5.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 -5.00000000000000004e154 < v < 9.99999999999999955e126Initial 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 9.99999999999999955e126 < v Initial program 32.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-eval32.2%
Simplified32.2%
Taylor expanded in v around inf
Simplified100.0%
Final simplification99.8%
(FPCore (v H) :precision binary64 (if (<= v -5e+154) (atan -1.0) (if (<= v 2e+127) (atan (/ v (sqrt (+ (* v v) (* H -19.6))))) (atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -5e+154) {
tmp = atan(-1.0);
} else if (v <= 2e+127) {
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 <= (-5d+154)) then
tmp = atan((-1.0d0))
else if (v <= 2d+127) 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 <= -5e+154) {
tmp = Math.atan(-1.0);
} else if (v <= 2e+127) {
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 <= -5e+154: tmp = math.atan(-1.0) elif v <= 2e+127: 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 <= -5e+154) tmp = atan(-1.0); elseif (v <= 2e+127) 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 <= -5e+154) tmp = atan(-1.0); elseif (v <= 2e+127) 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, -5e+154], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 2e+127], 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 -5 \cdot 10^{+154}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 2 \cdot 10^{+127}:\\
\;\;\;\;\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 < -5.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 -5.00000000000000004e154 < v < 1.99999999999999991e127Initial 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.99999999999999991e127 < v Initial program 32.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-eval32.2%
Simplified32.2%
Taylor expanded in v around inf
Simplified100.0%
(FPCore (v H)
:precision binary64
(if (<= v -5.2e-18)
(atan (/ v (- (* H (+ (/ 9.8 v) (* (/ H (* v (* v v))) 48.02))) v)))
(if (<= v 2e-26)
(atan (/ v (pow (/ -0.05102040816326531 H) -0.5)))
(atan (/ v (* v (+ 1.0 (* (/ H (* v v)) -9.8))))))))
double code(double v, double H) {
double tmp;
if (v <= -5.2e-18) {
tmp = atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v)));
} else if (v <= 2e-26) {
tmp = atan((v / pow((-0.05102040816326531 / H), -0.5)));
} else {
tmp = atan((v / (v * (1.0 + ((H / (v * v)) * -9.8)))));
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: tmp
if (v <= (-5.2d-18)) then
tmp = atan((v / ((h * ((9.8d0 / v) + ((h / (v * (v * v))) * 48.02d0))) - v)))
else if (v <= 2d-26) then
tmp = atan((v / (((-0.05102040816326531d0) / h) ** (-0.5d0))))
else
tmp = atan((v / (v * (1.0d0 + ((h / (v * v)) * (-9.8d0))))))
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -5.2e-18) {
tmp = Math.atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v)));
} else if (v <= 2e-26) {
tmp = Math.atan((v / Math.pow((-0.05102040816326531 / H), -0.5)));
} else {
tmp = Math.atan((v / (v * (1.0 + ((H / (v * v)) * -9.8)))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -5.2e-18: tmp = math.atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v))) elif v <= 2e-26: tmp = math.atan((v / math.pow((-0.05102040816326531 / H), -0.5))) else: tmp = math.atan((v / (v * (1.0 + ((H / (v * v)) * -9.8))))) return tmp
function code(v, H) tmp = 0.0 if (v <= -5.2e-18) tmp = atan(Float64(v / Float64(Float64(H * Float64(Float64(9.8 / v) + Float64(Float64(H / Float64(v * Float64(v * v))) * 48.02))) - v))); elseif (v <= 2e-26) tmp = atan(Float64(v / (Float64(-0.05102040816326531 / H) ^ -0.5))); else tmp = atan(Float64(v / Float64(v * Float64(1.0 + Float64(Float64(H / Float64(v * v)) * -9.8))))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -5.2e-18) tmp = atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v))); elseif (v <= 2e-26) tmp = atan((v / ((-0.05102040816326531 / H) ^ -0.5))); else tmp = atan((v / (v * (1.0 + ((H / (v * v)) * -9.8))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -5.2e-18], N[ArcTan[N[(v / N[(N[(H * N[(N[(9.8 / v), $MachinePrecision] + N[(N[(H / N[(v * N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 48.02), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[v, 2e-26], N[ArcTan[N[(v / N[Power[N[(-0.05102040816326531 / H), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(v / N[(v * N[(1.0 + N[(N[(H / N[(v * v), $MachinePrecision]), $MachinePrecision] * -9.8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -5.2 \cdot 10^{-18}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{H \cdot \left(\frac{9.8}{v} + \frac{H}{v \cdot \left(v \cdot v\right)} \cdot 48.02\right) - v}\right)\\
\mathbf{elif}\;v \leq 2 \cdot 10^{-26}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{{\left(\frac{-0.05102040816326531}{H}\right)}^{-0.5}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v \cdot \left(1 + \frac{H}{v \cdot v} \cdot -9.8\right)}\right)\\
\end{array}
\end{array}
if v < -5.2000000000000001e-18Initial program 51.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-eval51.5%
Simplified51.5%
Taylor expanded in v around -inf
Simplified83.3%
Taylor expanded in H around 0
Simplified95.3%
if -5.2000000000000001e-18 < v < 2.0000000000000001e-26Initial 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%
flip-+N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in v around 0
rem-square-sqrtN/A
unpow2N/A
/-lowering-/.f64N/A
unpow2N/A
rem-square-sqrt91.9%
Simplified91.9%
if 2.0000000000000001e-26 < v Initial program 60.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-eval60.1%
Simplified60.1%
flip-+N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-eval60.1%
Applied egg-rr60.1%
Taylor expanded in v around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6490.8%
Simplified90.8%
(FPCore (v H)
:precision binary64
(if (<= v -9.5e-5)
(atan (/ v (- (* H (+ (/ 9.8 v) (* (/ H (* v (* v v))) 48.02))) v)))
(if (<= v 5.2e-40)
(atan (* v (pow (* H -19.6) -0.5)))
(atan (/ v (* v (+ 1.0 (* (/ H (* v v)) -9.8))))))))
double code(double v, double H) {
double tmp;
if (v <= -9.5e-5) {
tmp = atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v)));
} else if (v <= 5.2e-40) {
tmp = atan((v * pow((H * -19.6), -0.5)));
} else {
tmp = atan((v / (v * (1.0 + ((H / (v * v)) * -9.8)))));
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: tmp
if (v <= (-9.5d-5)) then
tmp = atan((v / ((h * ((9.8d0 / v) + ((h / (v * (v * v))) * 48.02d0))) - v)))
else if (v <= 5.2d-40) then
tmp = atan((v * ((h * (-19.6d0)) ** (-0.5d0))))
else
tmp = atan((v / (v * (1.0d0 + ((h / (v * v)) * (-9.8d0))))))
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -9.5e-5) {
tmp = Math.atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v)));
} else if (v <= 5.2e-40) {
tmp = Math.atan((v * Math.pow((H * -19.6), -0.5)));
} else {
tmp = Math.atan((v / (v * (1.0 + ((H / (v * v)) * -9.8)))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -9.5e-5: tmp = math.atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v))) elif v <= 5.2e-40: tmp = math.atan((v * math.pow((H * -19.6), -0.5))) else: tmp = math.atan((v / (v * (1.0 + ((H / (v * v)) * -9.8))))) return tmp
function code(v, H) tmp = 0.0 if (v <= -9.5e-5) tmp = atan(Float64(v / Float64(Float64(H * Float64(Float64(9.8 / v) + Float64(Float64(H / Float64(v * Float64(v * v))) * 48.02))) - v))); elseif (v <= 5.2e-40) tmp = atan(Float64(v * (Float64(H * -19.6) ^ -0.5))); else tmp = atan(Float64(v / Float64(v * Float64(1.0 + Float64(Float64(H / Float64(v * v)) * -9.8))))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -9.5e-5) tmp = atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v))); elseif (v <= 5.2e-40) tmp = atan((v * ((H * -19.6) ^ -0.5))); else tmp = atan((v / (v * (1.0 + ((H / (v * v)) * -9.8))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -9.5e-5], N[ArcTan[N[(v / N[(N[(H * N[(N[(9.8 / v), $MachinePrecision] + N[(N[(H / N[(v * N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 48.02), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[v, 5.2e-40], N[ArcTan[N[(v * N[Power[N[(H * -19.6), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(v / N[(v * N[(1.0 + N[(N[(H / N[(v * v), $MachinePrecision]), $MachinePrecision] * -9.8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -9.5 \cdot 10^{-5}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{H \cdot \left(\frac{9.8}{v} + \frac{H}{v \cdot \left(v \cdot v\right)} \cdot 48.02\right) - v}\right)\\
\mathbf{elif}\;v \leq 5.2 \cdot 10^{-40}:\\
\;\;\;\;\tan^{-1} \left(v \cdot {\left(H \cdot -19.6\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v \cdot \left(1 + \frac{H}{v \cdot v} \cdot -9.8\right)}\right)\\
\end{array}
\end{array}
if v < -9.5000000000000005e-5Initial program 51.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-eval51.5%
Simplified51.5%
Taylor expanded in v around -inf
Simplified83.3%
Taylor expanded in H around 0
Simplified95.3%
if -9.5000000000000005e-5 < v < 5.2000000000000003e-40Initial 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.6%
Applied egg-rr99.6%
Taylor expanded in v around 0
*-lowering-*.f6491.9%
Simplified91.9%
if 5.2000000000000003e-40 < v Initial program 60.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-eval60.1%
Simplified60.1%
flip-+N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-eval60.1%
Applied egg-rr60.1%
Taylor expanded in v around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6490.8%
Simplified90.8%
Final simplification92.5%
(FPCore (v H)
:precision binary64
(if (<= v -4.4e-16)
(atan (/ v (- (* H (+ (/ 9.8 v) (* (/ H (* v (* v v))) 48.02))) v)))
(if (<= v 1.08e-35)
(atan (/ v (sqrt (* H -19.6))))
(atan (/ v (* v (+ 1.0 (* (/ H (* v v)) -9.8))))))))
double code(double v, double H) {
double tmp;
if (v <= -4.4e-16) {
tmp = atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v)));
} else if (v <= 1.08e-35) {
tmp = atan((v / sqrt((H * -19.6))));
} else {
tmp = atan((v / (v * (1.0 + ((H / (v * v)) * -9.8)))));
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: tmp
if (v <= (-4.4d-16)) then
tmp = atan((v / ((h * ((9.8d0 / v) + ((h / (v * (v * v))) * 48.02d0))) - v)))
else if (v <= 1.08d-35) then
tmp = atan((v / sqrt((h * (-19.6d0)))))
else
tmp = atan((v / (v * (1.0d0 + ((h / (v * v)) * (-9.8d0))))))
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -4.4e-16) {
tmp = Math.atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v)));
} else if (v <= 1.08e-35) {
tmp = Math.atan((v / Math.sqrt((H * -19.6))));
} else {
tmp = Math.atan((v / (v * (1.0 + ((H / (v * v)) * -9.8)))));
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -4.4e-16: tmp = math.atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v))) elif v <= 1.08e-35: tmp = math.atan((v / math.sqrt((H * -19.6)))) else: tmp = math.atan((v / (v * (1.0 + ((H / (v * v)) * -9.8))))) return tmp
function code(v, H) tmp = 0.0 if (v <= -4.4e-16) tmp = atan(Float64(v / Float64(Float64(H * Float64(Float64(9.8 / v) + Float64(Float64(H / Float64(v * Float64(v * v))) * 48.02))) - v))); elseif (v <= 1.08e-35) tmp = atan(Float64(v / sqrt(Float64(H * -19.6)))); else tmp = atan(Float64(v / Float64(v * Float64(1.0 + Float64(Float64(H / Float64(v * v)) * -9.8))))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -4.4e-16) tmp = atan((v / ((H * ((9.8 / v) + ((H / (v * (v * v))) * 48.02))) - v))); elseif (v <= 1.08e-35) tmp = atan((v / sqrt((H * -19.6)))); else tmp = atan((v / (v * (1.0 + ((H / (v * v)) * -9.8))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -4.4e-16], N[ArcTan[N[(v / N[(N[(H * N[(N[(9.8 / v), $MachinePrecision] + N[(N[(H / N[(v * N[(v * v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 48.02), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[v, 1.08e-35], N[ArcTan[N[(v / N[Sqrt[N[(H * -19.6), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(v / N[(v * N[(1.0 + N[(N[(H / N[(v * v), $MachinePrecision]), $MachinePrecision] * -9.8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -4.4 \cdot 10^{-16}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{H \cdot \left(\frac{9.8}{v} + \frac{H}{v \cdot \left(v \cdot v\right)} \cdot 48.02\right) - v}\right)\\
\mathbf{elif}\;v \leq 1.08 \cdot 10^{-35}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{\sqrt{H \cdot -19.6}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v \cdot \left(1 + \frac{H}{v \cdot v} \cdot -9.8\right)}\right)\\
\end{array}
\end{array}
if v < -4.40000000000000001e-16Initial program 51.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-eval51.5%
Simplified51.5%
Taylor expanded in v around -inf
Simplified83.3%
Taylor expanded in H around 0
Simplified95.3%
if -4.40000000000000001e-16 < v < 1.08000000000000003e-35Initial 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
*-lowering-*.f6491.8%
Simplified91.8%
if 1.08000000000000003e-35 < v Initial program 60.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-eval60.1%
Simplified60.1%
flip-+N/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-eval60.1%
Applied egg-rr60.1%
Taylor expanded in v around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6490.8%
Simplified90.8%
Final simplification92.5%
(FPCore (v H)
:precision binary64
(if (<= v -4.3e-113)
(atan -1.0)
(if (<= v 3.4e-133)
(atan (* v (/ 0.10204081632653061 (/ H v))))
(atan 1.0))))
double code(double v, double H) {
double tmp;
if (v <= -4.3e-113) {
tmp = atan(-1.0);
} else if (v <= 3.4e-133) {
tmp = atan((v * (0.10204081632653061 / (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 <= (-4.3d-113)) then
tmp = atan((-1.0d0))
else if (v <= 3.4d-133) then
tmp = atan((v * (0.10204081632653061d0 / (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 <= -4.3e-113) {
tmp = Math.atan(-1.0);
} else if (v <= 3.4e-133) {
tmp = Math.atan((v * (0.10204081632653061 / (H / v))));
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -4.3e-113: tmp = math.atan(-1.0) elif v <= 3.4e-133: tmp = math.atan((v * (0.10204081632653061 / (H / v)))) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -4.3e-113) tmp = atan(-1.0); elseif (v <= 3.4e-133) tmp = atan(Float64(v * Float64(0.10204081632653061 / Float64(H / v)))); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -4.3e-113) tmp = atan(-1.0); elseif (v <= 3.4e-133) tmp = atan((v * (0.10204081632653061 / (H / v)))); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -4.3e-113], N[ArcTan[-1.0], $MachinePrecision], If[LessEqual[v, 3.4e-133], N[ArcTan[N[(v * N[(0.10204081632653061 / N[(H / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -4.3 \cdot 10^{-113}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{elif}\;v \leq 3.4 \cdot 10^{-133}:\\
\;\;\;\;\tan^{-1} \left(v \cdot \frac{0.10204081632653061}{\frac{H}{v}}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -4.3e-113Initial program 59.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-eval59.7%
Simplified59.7%
Taylor expanded in v around -inf
Simplified83.7%
if -4.3e-113 < v < 3.40000000000000006e-133Initial 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%
Taylor expanded in v around -inf
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
Simplified23.8%
Taylor expanded in v around 0
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6423.5%
Simplified23.5%
associate-/l*N/A
associate-*l*N/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
neg-mul-1N/A
frac-2negN/A
*-lowering-*.f64N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f6423.8%
Applied egg-rr23.8%
if 3.40000000000000006e-133 < v Initial program 66.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-eval66.9%
Simplified66.9%
Taylor expanded in v around inf
Simplified78.7%
(FPCore (v H) :precision binary64 (if (<= v -2e-291) (atan (* v (/ 1.0 (- (* 9.8 (/ H v)) v)))) (atan (/ v (+ v (* H (/ -9.8 v)))))))
double code(double v, double H) {
double tmp;
if (v <= -2e-291) {
tmp = atan((v * (1.0 / ((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-291)) then
tmp = atan((v * (1.0d0 / ((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-291) {
tmp = Math.atan((v * (1.0 / ((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-291: tmp = math.atan((v * (1.0 / ((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-291) tmp = atan(Float64(v * Float64(1.0 / Float64(Float64(9.8 * Float64(H / v)) - v)))); else tmp = atan(Float64(v / Float64(v + Float64(H * Float64(-9.8 / v))))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -2e-291) tmp = atan((v * (1.0 / ((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-291], N[ArcTan[N[(v * N[(1.0 / N[(N[(9.8 * N[(H / v), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(v / N[(v + N[(H * N[(-9.8 / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2 \cdot 10^{-291}:\\
\;\;\;\;\tan^{-1} \left(v \cdot \frac{1}{9.8 \cdot \frac{H}{v} - v}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + H \cdot \frac{-9.8}{v}}\right)\\
\end{array}
\end{array}
if v < -1.99999999999999992e-291Initial program 68.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-eval68.6%
Simplified68.6%
Taylor expanded in v around -inf
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
Simplified68.2%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
mul-1-negN/A
associate-*r/N/A
distribute-neg-frac2N/A
*-commutativeN/A
neg-mul-1N/A
times-fracN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-evalN/A
/-lowering-/.f6468.2%
Applied egg-rr68.2%
if -1.99999999999999992e-291 < v Initial program 74.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-eval74.7%
Simplified74.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
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6468.2%
Simplified68.2%
Final simplification68.2%
(FPCore (v H) :precision binary64 (if (<= v -2e-291) (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-291) {
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-291)) 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-291) {
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-291: 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-291) tmp = atan(Float64(v / Float64(Float64(9.8 * Float64(H / v)) - v))); else tmp = atan(Float64(v / Float64(v + Float64(H * Float64(-9.8 / v))))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -2e-291) 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-291], N[ArcTan[N[(v / N[(N[(9.8 * N[(H / v), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(v / N[(v + N[(H * N[(-9.8 / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2 \cdot 10^{-291}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{9.8 \cdot \frac{H}{v} - v}\right)\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + H \cdot \frac{-9.8}{v}}\right)\\
\end{array}
\end{array}
if v < -1.99999999999999992e-291Initial program 68.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-eval68.6%
Simplified68.6%
Taylor expanded in v around -inf
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
Simplified68.2%
associate-*r*N/A
clear-numN/A
un-div-invN/A
*-commutativeN/A
div-invN/A
times-fracN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-eval68.2%
Applied egg-rr68.2%
if -1.99999999999999992e-291 < v Initial program 74.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-eval74.7%
Simplified74.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
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6468.2%
Simplified68.2%
Final simplification68.2%
(FPCore (v H) :precision binary64 (if (<= v -8.5e-217) (atan -1.0) (atan (/ v (+ v (* H (/ -9.8 v)))))))
double code(double v, double H) {
double tmp;
if (v <= -8.5e-217) {
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 <= (-8.5d-217)) 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 <= -8.5e-217) {
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 <= -8.5e-217: 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 <= -8.5e-217) tmp = atan(-1.0); else tmp = atan(Float64(v / Float64(v + Float64(H * Float64(-9.8 / v))))); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -8.5e-217) tmp = atan(-1.0); else tmp = atan((v / (v + (H * (-9.8 / v))))); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -8.5e-217], N[ArcTan[-1.0], $MachinePrecision], N[ArcTan[N[(v / N[(v + N[(H * N[(-9.8 / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -8.5 \cdot 10^{-217}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(\frac{v}{v + H \cdot \frac{-9.8}{v}}\right)\\
\end{array}
\end{array}
if v < -8.4999999999999994e-217Initial program 66.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-eval66.3%
Simplified66.3%
Taylor expanded in v around -inf
Simplified70.5%
if -8.4999999999999994e-217 < v Initial program 76.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-eval76.1%
Simplified76.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
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f6466.0%
Simplified66.0%
(FPCore (v H) :precision binary64 (if (<= v -2e-310) (atan -1.0) (atan 1.0)))
double code(double v, double H) {
double tmp;
if (v <= -2e-310) {
tmp = atan(-1.0);
} else {
tmp = atan(1.0);
}
return tmp;
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
real(8) :: tmp
if (v <= (-2d-310)) then
tmp = atan((-1.0d0))
else
tmp = atan(1.0d0)
end if
code = tmp
end function
public static double code(double v, double H) {
double tmp;
if (v <= -2e-310) {
tmp = Math.atan(-1.0);
} else {
tmp = Math.atan(1.0);
}
return tmp;
}
def code(v, H): tmp = 0 if v <= -2e-310: tmp = math.atan(-1.0) else: tmp = math.atan(1.0) return tmp
function code(v, H) tmp = 0.0 if (v <= -2e-310) tmp = atan(-1.0); else tmp = atan(1.0); end return tmp end
function tmp_2 = code(v, H) tmp = 0.0; if (v <= -2e-310) tmp = atan(-1.0); else tmp = atan(1.0); end tmp_2 = tmp; end
code[v_, H_] := If[LessEqual[v, -2e-310], N[ArcTan[-1.0], $MachinePrecision], N[ArcTan[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\tan^{-1} -1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1} 1\\
\end{array}
\end{array}
if v < -1.999999999999994e-310Initial program 69.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-eval69.3%
Simplified69.3%
Taylor expanded in v around -inf
Simplified64.5%
if -1.999999999999994e-310 < v Initial program 74.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-eval74.2%
Simplified74.2%
Taylor expanded in v around inf
Simplified62.3%
(FPCore (v H) :precision binary64 (atan -1.0))
double code(double v, double H) {
return atan(-1.0);
}
real(8) function code(v, h)
real(8), intent (in) :: v
real(8), intent (in) :: h
code = atan((-1.0d0))
end function
public static double code(double v, double H) {
return Math.atan(-1.0);
}
def code(v, H): return math.atan(-1.0)
function code(v, H) return atan(-1.0) end
function tmp = code(v, H) tmp = atan(-1.0); end
code[v_, H_] := N[ArcTan[-1.0], $MachinePrecision]
\begin{array}{l}
\\
\tan^{-1} -1
\end{array}
Initial program 71.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-eval71.8%
Simplified71.8%
Taylor expanded in v around -inf
Simplified32.2%
herbie shell --seed 2024191
(FPCore (v H)
:name "Optimal throwing angle"
:precision binary64
(atan (/ v (sqrt (- (* v v) (* (* 2.0 9.8) H))))))