Optimal throwing angle

Percentage Accurate: 66.7% → 98.9%
Time: 10.1s
Alternatives: 8
Speedup: 2.0×

Specification

?
\[\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
 (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:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 66.7% accurate, 1.0× speedup?

\[\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
 (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}

Alternative 1: 98.9% accurate, 1.0× speedup?

\[\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} \]
(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}
Derivation
  1. Split input into 3 regimes
  2. if v < -1.00000000000000001e155

    1. Initial program 3.1%

      \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
    2. Step-by-step derivation
      1. atan-lowering-atan.f64N/A

        \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
      4. sub-negN/A

        \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
      11. metadata-eval3.1%

        \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
    3. Simplified3.1%

      \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in v around -inf

      \[\leadsto \mathsf{atan.f64}\left(\color{blue}{-1}\right) \]
    6. Step-by-step derivation
      1. Simplified100.0%

        \[\leadsto \tan^{-1} \color{blue}{-1} \]

      if -1.00000000000000001e155 < v < 1.8999999999999999e49

      1. Initial program 99.7%

        \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
      2. Step-by-step derivation
        1. atan-lowering-atan.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
        3. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
        4. sub-negN/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
        8. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
        11. metadata-eval99.7%

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
      3. Simplified99.7%

        \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
      4. Add Preprocessing

      if 1.8999999999999999e49 < v

      1. Initial program 36.9%

        \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
      2. Step-by-step derivation
        1. atan-lowering-atan.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
        3. sqrt-lowering-sqrt.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
        4. sub-negN/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
        8. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
        11. metadata-eval36.9%

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
      3. Simplified36.9%

        \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in v around inf

        \[\leadsto \mathsf{atan.f64}\left(\color{blue}{1}\right) \]
      6. Step-by-step derivation
        1. Simplified100.0%

          \[\leadsto \tan^{-1} \color{blue}{1} \]
      7. Recombined 3 regimes into one program.
      8. Add Preprocessing

      Alternative 2: 89.4% accurate, 1.0× speedup?

      \[\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} \]
      (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}
      
      Derivation
      1. Split input into 3 regimes
      2. if v < -6.1999999999999994e-39

        1. Initial program 49.2%

          \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
        2. Step-by-step derivation
          1. atan-lowering-atan.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
          3. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          8. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
          11. metadata-eval49.2%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
        3. Simplified49.2%

          \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in v around -inf

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \color{blue}{\left(-1 \cdot \left(v \cdot \left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right)\right)\right)}\right)\right) \]
        6. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\left(-1 \cdot v\right) \cdot \left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right)\right)\right)\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right) \cdot \left(-1 \cdot v\right)\right)\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{*.f64}\left(\left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right), \left(-1 \cdot v\right)\right)\right)\right) \]
        7. Simplified78.6%

          \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{\left(\left(1 + \frac{H}{v \cdot v} \cdot -9.8\right) + \frac{\left(H \cdot H\right) \cdot -48.02}{\left(v \cdot v\right) \cdot \left(v \cdot v\right)}\right) \cdot \left(0 - v\right)}}\right) \]
        8. Taylor expanded in H around 0

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \color{blue}{\left(-1 \cdot v + \frac{49}{5} \cdot \frac{H}{v}\right)}\right)\right) \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{49}{5} \cdot \frac{H}{v} + -1 \cdot v\right)\right)\right) \]
          2. mul-1-negN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{49}{5} \cdot \frac{H}{v} + \left(\mathsf{neg}\left(v\right)\right)\right)\right)\right) \]
          3. unsub-negN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{49}{5} \cdot \frac{H}{v} - v\right)\right)\right) \]
          4. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{\frac{49}{5} \cdot H}{v} - v\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{H \cdot \frac{49}{5}}{v} - v\right)\right)\right) \]
          6. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(H \cdot \frac{\frac{49}{5}}{v} - v\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(H \cdot \frac{\frac{49}{5} \cdot 1}{v} - v\right)\right)\right) \]
          8. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(H \cdot \left(\frac{49}{5} \cdot \frac{1}{v}\right) - v\right)\right)\right) \]
          9. --lowering--.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(H \cdot \left(\frac{49}{5} \cdot \frac{1}{v}\right)\right), v\right)\right)\right) \]
          10. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(H \cdot \frac{\frac{49}{5} \cdot 1}{v}\right), v\right)\right)\right) \]
          11. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(H \cdot \frac{\frac{49}{5}}{v}\right), v\right)\right)\right) \]
          12. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(\frac{H \cdot \frac{49}{5}}{v}\right), v\right)\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(\frac{\frac{49}{5} \cdot H}{v}\right), v\right)\right)\right) \]
          14. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(\frac{49}{5} \cdot \frac{H}{v}\right), v\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{49}{5}, \left(\frac{H}{v}\right)\right), v\right)\right)\right) \]
          16. /-lowering-/.f6493.5%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{49}{5}, \mathsf{/.f64}\left(H, v\right)\right), v\right)\right)\right) \]
        10. Simplified93.5%

          \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{9.8 \cdot \frac{H}{v} - v}}\right) \]

        if -6.1999999999999994e-39 < v < 1.55000000000000008e-80

        1. Initial program 99.5%

          \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
        2. Step-by-step derivation
          1. atan-lowering-atan.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
          3. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          8. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
          11. metadata-eval99.5%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
        3. Simplified99.5%

          \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
        4. Add Preprocessing
        5. Step-by-step derivation
          1. pow1/2N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left({\left(v \cdot v + H \cdot \frac{-98}{5}\right)}^{\frac{1}{2}}\right)\right)\right) \]
          2. flip-+N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left({\left(\frac{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - \left(H \cdot \frac{-98}{5}\right) \cdot \left(H \cdot \frac{-98}{5}\right)}{v \cdot v - H \cdot \frac{-98}{5}}\right)}^{\frac{1}{2}}\right)\right)\right) \]
          3. fmm-defN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left({\left(\frac{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - \left(H \cdot \frac{-98}{5}\right) \cdot \left(H \cdot \frac{-98}{5}\right)}{\mathsf{fma}\left(v, v, \mathsf{neg}\left(H \cdot \frac{-98}{5}\right)\right)}\right)}^{\frac{1}{2}}\right)\right)\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left({\left(\frac{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - \left(H \cdot \frac{-98}{5}\right) \cdot \left(H \cdot \frac{-98}{5}\right)}{\mathsf{fma}\left(v, v, \mathsf{neg}\left(\frac{-98}{5} \cdot H\right)\right)}\right)}^{\frac{1}{2}}\right)\right)\right) \]
          5. clear-numN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left({\left(\frac{1}{\frac{\mathsf{fma}\left(v, v, \mathsf{neg}\left(\frac{-98}{5} \cdot H\right)\right)}{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - \left(H \cdot \frac{-98}{5}\right) \cdot \left(H \cdot \frac{-98}{5}\right)}}\right)}^{\frac{1}{2}}\right)\right)\right) \]
          6. inv-powN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left({\left({\left(\frac{\mathsf{fma}\left(v, v, \mathsf{neg}\left(\frac{-98}{5} \cdot H\right)\right)}{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - \left(H \cdot \frac{-98}{5}\right) \cdot \left(H \cdot \frac{-98}{5}\right)}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right)\right) \]
          7. pow-powN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left({\left(\frac{\mathsf{fma}\left(v, v, \mathsf{neg}\left(\frac{-98}{5} \cdot H\right)\right)}{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - \left(H \cdot \frac{-98}{5}\right) \cdot \left(H \cdot \frac{-98}{5}\right)}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right)\right)\right) \]
          8. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left({\left(\frac{\mathsf{fma}\left(v, v, \mathsf{neg}\left(\frac{-98}{5} \cdot H\right)\right)}{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - \left(H \cdot \frac{-98}{5}\right) \cdot \left(H \cdot \frac{-98}{5}\right)}\right)}^{\frac{-1}{2}}\right)\right)\right) \]
          9. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left({\left(\frac{\mathsf{fma}\left(v, v, \mathsf{neg}\left(\frac{-98}{5} \cdot H\right)\right)}{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - \left(H \cdot \frac{-98}{5}\right) \cdot \left(H \cdot \frac{-98}{5}\right)}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)\right)\right) \]
          10. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{pow.f64}\left(\left(\frac{\mathsf{fma}\left(v, v, \mathsf{neg}\left(\frac{-98}{5} \cdot H\right)\right)}{\left(v \cdot v\right) \cdot \left(v \cdot v\right) - \left(H \cdot \frac{-98}{5}\right) \cdot \left(H \cdot \frac{-98}{5}\right)}\right), \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right)\right) \]
        6. Applied egg-rr99.5%

          \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{{\left(\frac{1}{v \cdot v + H \cdot -19.6}\right)}^{-0.5}}}\right) \]
        7. Taylor expanded in v around 0

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{pow.f64}\left(\color{blue}{\left(\frac{\frac{-5}{98}}{H}\right)}, \frac{-1}{2}\right)\right)\right) \]
        8. Step-by-step derivation
          1. /-lowering-/.f6492.1%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\frac{-5}{98}, H\right), \frac{-1}{2}\right)\right)\right) \]
        9. Simplified92.1%

          \[\leadsto \tan^{-1} \left(\frac{v}{{\color{blue}{\left(\frac{-0.05102040816326531}{H}\right)}}^{-0.5}}\right) \]
        10. Step-by-step derivation
          1. clear-numN/A

            \[\leadsto \mathsf{atan.f64}\left(\left(\frac{1}{\frac{{\left(\frac{\frac{-5}{98}}{H}\right)}^{\frac{-1}{2}}}{v}}\right)\right) \]
          2. associate-/r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\left(\frac{1}{{\left(\frac{\frac{-5}{98}}{H}\right)}^{\frac{-1}{2}}} \cdot v\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{{\left(\frac{\frac{-5}{98}}{H}\right)}^{\frac{-1}{2}}}\right), v\right)\right) \]
          4. pow-flipN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\left({\left(\frac{\frac{-5}{98}}{H}\right)}^{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)}\right), v\right)\right) \]
          5. clear-numN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\left({\left(\frac{1}{\frac{H}{\frac{-5}{98}}}\right)}^{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)}\right), v\right)\right) \]
          6. inv-powN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\left({\left({\left(\frac{H}{\frac{-5}{98}}\right)}^{-1}\right)}^{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)}\right), v\right)\right) \]
          7. div-invN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\left({\left({\left(H \cdot \frac{1}{\frac{-5}{98}}\right)}^{-1}\right)}^{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)}\right), v\right)\right) \]
          8. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\left({\left({\left(H \cdot \frac{-98}{5}\right)}^{-1}\right)}^{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)}\right), v\right)\right) \]
          9. pow-powN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\left({\left(H \cdot \frac{-98}{5}\right)}^{\left(-1 \cdot \left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)\right)}\right), v\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\left({\left(H \cdot \frac{-98}{5}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), v\right)\right) \]
          11. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\left({\left(H \cdot \frac{-98}{5}\right)}^{\frac{-1}{2}}\right), v\right)\right) \]
          12. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(H \cdot \frac{-98}{5}\right), \frac{-1}{2}\right), v\right)\right) \]
          13. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(H \cdot \frac{1}{\frac{-5}{98}}\right), \frac{-1}{2}\right), v\right)\right) \]
          14. div-invN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{H}{\frac{-5}{98}}\right), \frac{-1}{2}\right), v\right)\right) \]
          15. /-lowering-/.f6492.1%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(H, \frac{-5}{98}\right), \frac{-1}{2}\right), v\right)\right) \]
        11. Applied egg-rr92.1%

          \[\leadsto \tan^{-1} \color{blue}{\left({\left(\frac{H}{-0.05102040816326531}\right)}^{-0.5} \cdot v\right)} \]

        if 1.55000000000000008e-80 < v

        1. Initial program 55.6%

          \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
        2. Step-by-step derivation
          1. atan-lowering-atan.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
          3. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          8. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
          11. metadata-eval55.6%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
        3. Simplified55.6%

          \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in H around 0

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \color{blue}{\left(v + \frac{-49}{5} \cdot \frac{H}{v}\right)}\right)\right) \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + \frac{H}{v} \cdot \frac{-49}{5}\right)\right)\right) \]
          2. associate-*l/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + \frac{H \cdot \frac{-49}{5}}{v}\right)\right)\right) \]
          3. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \frac{\frac{-49}{5}}{v}\right)\right)\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \frac{\mathsf{neg}\left(\frac{49}{5}\right)}{v}\right)\right)\right) \]
          5. distribute-neg-fracN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5}}{v}\right)\right)\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5} \cdot 1}{v}\right)\right)\right)\right)\right) \]
          7. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{49}{5} \cdot \frac{1}{v}\right)\right)\right)\right)\right) \]
          8. +-lowering-+.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{49}{5} \cdot \frac{1}{v}\right)\right)\right)\right)\right)\right) \]
          9. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5} \cdot 1}{v}\right)\right)\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5}}{v}\right)\right)\right)\right)\right)\right) \]
          11. distribute-neg-fracN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \frac{\mathsf{neg}\left(\frac{49}{5}\right)}{v}\right)\right)\right)\right) \]
          12. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \frac{\frac{-49}{5}}{v}\right)\right)\right)\right) \]
          13. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(\frac{H \cdot \frac{-49}{5}}{v}\right)\right)\right)\right) \]
          14. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(\frac{\frac{-49}{5} \cdot H}{v}\right)\right)\right)\right) \]
          15. /-lowering-/.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\left(\frac{-49}{5} \cdot H\right), v\right)\right)\right)\right) \]
          16. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\left(H \cdot \frac{-49}{5}\right), v\right)\right)\right)\right) \]
          17. *-lowering-*.f6490.9%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\mathsf{*.f64}\left(H, \frac{-49}{5}\right), v\right)\right)\right)\right) \]
        7. Simplified90.9%

          \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{v + \frac{H \cdot -9.8}{v}}}\right) \]
      3. Recombined 3 regimes into one program.
      4. Final simplification92.1%

        \[\leadsto \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} \]
      5. Add Preprocessing

      Alternative 3: 89.4% accurate, 1.0× speedup?

      \[\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} \]
      (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}
      
      Derivation
      1. Split input into 3 regimes
      2. if v < -2.94999999999999991e-38

        1. Initial program 49.2%

          \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
        2. Step-by-step derivation
          1. atan-lowering-atan.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
          3. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          8. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
          11. metadata-eval49.2%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
        3. Simplified49.2%

          \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in v around -inf

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \color{blue}{\left(-1 \cdot \left(v \cdot \left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right)\right)\right)}\right)\right) \]
        6. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\left(-1 \cdot v\right) \cdot \left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right)\right)\right)\right) \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right) \cdot \left(-1 \cdot v\right)\right)\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{*.f64}\left(\left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right), \left(-1 \cdot v\right)\right)\right)\right) \]
        7. Simplified78.6%

          \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{\left(\left(1 + \frac{H}{v \cdot v} \cdot -9.8\right) + \frac{\left(H \cdot H\right) \cdot -48.02}{\left(v \cdot v\right) \cdot \left(v \cdot v\right)}\right) \cdot \left(0 - v\right)}}\right) \]
        8. Taylor expanded in H around 0

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \color{blue}{\left(-1 \cdot v + \frac{49}{5} \cdot \frac{H}{v}\right)}\right)\right) \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{49}{5} \cdot \frac{H}{v} + -1 \cdot v\right)\right)\right) \]
          2. mul-1-negN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{49}{5} \cdot \frac{H}{v} + \left(\mathsf{neg}\left(v\right)\right)\right)\right)\right) \]
          3. unsub-negN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{49}{5} \cdot \frac{H}{v} - v\right)\right)\right) \]
          4. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{\frac{49}{5} \cdot H}{v} - v\right)\right)\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{H \cdot \frac{49}{5}}{v} - v\right)\right)\right) \]
          6. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(H \cdot \frac{\frac{49}{5}}{v} - v\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(H \cdot \frac{\frac{49}{5} \cdot 1}{v} - v\right)\right)\right) \]
          8. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(H \cdot \left(\frac{49}{5} \cdot \frac{1}{v}\right) - v\right)\right)\right) \]
          9. --lowering--.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(H \cdot \left(\frac{49}{5} \cdot \frac{1}{v}\right)\right), v\right)\right)\right) \]
          10. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(H \cdot \frac{\frac{49}{5} \cdot 1}{v}\right), v\right)\right)\right) \]
          11. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(H \cdot \frac{\frac{49}{5}}{v}\right), v\right)\right)\right) \]
          12. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(\frac{H \cdot \frac{49}{5}}{v}\right), v\right)\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(\frac{\frac{49}{5} \cdot H}{v}\right), v\right)\right)\right) \]
          14. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(\frac{49}{5} \cdot \frac{H}{v}\right), v\right)\right)\right) \]
          15. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{49}{5}, \left(\frac{H}{v}\right)\right), v\right)\right)\right) \]
          16. /-lowering-/.f6493.5%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{49}{5}, \mathsf{/.f64}\left(H, v\right)\right), v\right)\right)\right) \]
        10. Simplified93.5%

          \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{9.8 \cdot \frac{H}{v} - v}}\right) \]

        if -2.94999999999999991e-38 < v < 1.3000000000000001e-77

        1. Initial program 99.5%

          \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
        2. Step-by-step derivation
          1. atan-lowering-atan.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
          3. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          8. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
          11. metadata-eval99.5%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
        3. Simplified99.5%

          \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in v around 0

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\color{blue}{\left(\frac{-98}{5} \cdot H\right)}\right)\right)\right) \]
        6. Step-by-step derivation
          1. *-lowering-*.f6492.0%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\frac{-98}{5}, H\right)\right)\right)\right) \]
        7. Simplified92.0%

          \[\leadsto \tan^{-1} \left(\frac{v}{\sqrt{\color{blue}{-19.6 \cdot H}}}\right) \]

        if 1.3000000000000001e-77 < v

        1. Initial program 55.6%

          \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
        2. Step-by-step derivation
          1. atan-lowering-atan.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
          3. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          8. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
          11. metadata-eval55.6%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
        3. Simplified55.6%

          \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in H around 0

          \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \color{blue}{\left(v + \frac{-49}{5} \cdot \frac{H}{v}\right)}\right)\right) \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + \frac{H}{v} \cdot \frac{-49}{5}\right)\right)\right) \]
          2. associate-*l/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + \frac{H \cdot \frac{-49}{5}}{v}\right)\right)\right) \]
          3. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \frac{\frac{-49}{5}}{v}\right)\right)\right) \]
          4. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \frac{\mathsf{neg}\left(\frac{49}{5}\right)}{v}\right)\right)\right) \]
          5. distribute-neg-fracN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5}}{v}\right)\right)\right)\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5} \cdot 1}{v}\right)\right)\right)\right)\right) \]
          7. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{49}{5} \cdot \frac{1}{v}\right)\right)\right)\right)\right) \]
          8. +-lowering-+.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{49}{5} \cdot \frac{1}{v}\right)\right)\right)\right)\right)\right) \]
          9. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5} \cdot 1}{v}\right)\right)\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5}}{v}\right)\right)\right)\right)\right)\right) \]
          11. distribute-neg-fracN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \frac{\mathsf{neg}\left(\frac{49}{5}\right)}{v}\right)\right)\right)\right) \]
          12. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \frac{\frac{-49}{5}}{v}\right)\right)\right)\right) \]
          13. associate-*r/N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(\frac{H \cdot \frac{-49}{5}}{v}\right)\right)\right)\right) \]
          14. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(\frac{\frac{-49}{5} \cdot H}{v}\right)\right)\right)\right) \]
          15. /-lowering-/.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\left(\frac{-49}{5} \cdot H\right), v\right)\right)\right)\right) \]
          16. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\left(H \cdot \frac{-49}{5}\right), v\right)\right)\right)\right) \]
          17. *-lowering-*.f6490.9%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\mathsf{*.f64}\left(H, \frac{-49}{5}\right), v\right)\right)\right)\right) \]
        7. Simplified90.9%

          \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{v + \frac{H \cdot -9.8}{v}}}\right) \]
      3. Recombined 3 regimes into one program.
      4. Final simplification92.1%

        \[\leadsto \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} \]
      5. Add Preprocessing

      Alternative 4: 72.2% accurate, 1.8× speedup?

      \[\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} \]
      (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}
      
      Derivation
      1. Split input into 3 regimes
      2. if v < -2.00000000000000005e-146

        1. Initial program 59.1%

          \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
        2. Step-by-step derivation
          1. atan-lowering-atan.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
          3. sqrt-lowering-sqrt.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          8. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
          11. metadata-eval59.1%

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
        3. Simplified59.1%

          \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in v around -inf

          \[\leadsto \mathsf{atan.f64}\left(\color{blue}{-1}\right) \]
        6. Step-by-step derivation
          1. Simplified79.8%

            \[\leadsto \tan^{-1} \color{blue}{-1} \]

          if -2.00000000000000005e-146 < v < 1.4e-104

          1. Initial program 99.5%

            \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
          2. Step-by-step derivation
            1. atan-lowering-atan.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
            3. sqrt-lowering-sqrt.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
            4. sub-negN/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
            5. +-lowering-+.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
            6. *-lowering-*.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
            8. distribute-rgt-neg-inN/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
            9. *-lowering-*.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
            10. metadata-evalN/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
            11. metadata-eval99.5%

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
          3. Simplified99.5%

            \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
          4. Add Preprocessing
          5. Taylor expanded in v around inf

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \color{blue}{\left(v \cdot \left(1 + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right)}\right)\right) \]
          6. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{*.f64}\left(v, \left(1 + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right)\right)\right) \]
            2. +-lowering-+.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{*.f64}\left(v, \mathsf{+.f64}\left(1, \left(\frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right)\right)\right)\right) \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{*.f64}\left(v, \mathsf{+.f64}\left(1, \left(\frac{H}{{v}^{2}} \cdot \frac{-49}{5}\right)\right)\right)\right)\right) \]
            4. *-lowering-*.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{*.f64}\left(v, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\frac{H}{{v}^{2}}\right), \frac{-49}{5}\right)\right)\right)\right)\right) \]
            5. /-lowering-/.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{*.f64}\left(v, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(H, \left({v}^{2}\right)\right), \frac{-49}{5}\right)\right)\right)\right)\right) \]
            6. unpow2N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{*.f64}\left(v, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(H, \left(v \cdot v\right)\right), \frac{-49}{5}\right)\right)\right)\right)\right) \]
            7. *-lowering-*.f6425.7%

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{*.f64}\left(v, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{/.f64}\left(H, \mathsf{*.f64}\left(v, v\right)\right), \frac{-49}{5}\right)\right)\right)\right)\right) \]
          7. Simplified25.7%

            \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{v \cdot \left(1 + \frac{H}{v \cdot v} \cdot -9.8\right)}}\right) \]
          8. Taylor expanded in H around -inf

            \[\leadsto \mathsf{atan.f64}\left(\color{blue}{\left(-1 \cdot \frac{\frac{25}{2401} \cdot \frac{{v}^{4}}{H} + \frac{5}{49} \cdot {v}^{2}}{H}\right)}\right) \]
          9. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{atan.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{25}{2401} \cdot \frac{{v}^{4}}{H} + \frac{5}{49} \cdot {v}^{2}}{H}\right)\right)\right) \]
            2. distribute-neg-frac2N/A

              \[\leadsto \mathsf{atan.f64}\left(\left(\frac{\frac{25}{2401} \cdot \frac{{v}^{4}}{H} + \frac{5}{49} \cdot {v}^{2}}{\mathsf{neg}\left(H\right)}\right)\right) \]
            3. mul-1-negN/A

              \[\leadsto \mathsf{atan.f64}\left(\left(\frac{\frac{25}{2401} \cdot \frac{{v}^{4}}{H} + \frac{5}{49} \cdot {v}^{2}}{-1 \cdot H}\right)\right) \]
            4. /-lowering-/.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(\left(\frac{25}{2401} \cdot \frac{{v}^{4}}{H} + \frac{5}{49} \cdot {v}^{2}\right), \left(-1 \cdot H\right)\right)\right) \]
          10. Simplified25.7%

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{\left(v \cdot \left(v \cdot \left(v \cdot v\right)\right)\right) \cdot \frac{0.010412328196584756}{H} + \left(v \cdot v\right) \cdot 0.10204081632653061}{-H}\right)} \]
          11. Step-by-step derivation
            1. neg-mul-1N/A

              \[\leadsto \mathsf{atan.f64}\left(\left(\frac{\left(v \cdot \left(v \cdot \left(v \cdot v\right)\right)\right) \cdot \frac{\frac{25}{2401}}{H} + \left(v \cdot v\right) \cdot \frac{5}{49}}{-1 \cdot H}\right)\right) \]
            2. associate-*l*N/A

              \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v \cdot \left(\left(v \cdot \left(v \cdot v\right)\right) \cdot \frac{\frac{25}{2401}}{H}\right) + \left(v \cdot v\right) \cdot \frac{5}{49}}{-1 \cdot H}\right)\right) \]
            3. associate-*l*N/A

              \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v \cdot \left(\left(v \cdot \left(v \cdot v\right)\right) \cdot \frac{\frac{25}{2401}}{H}\right) + v \cdot \left(v \cdot \frac{5}{49}\right)}{-1 \cdot H}\right)\right) \]
            4. distribute-lft-outN/A

              \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v \cdot \left(\left(v \cdot \left(v \cdot v\right)\right) \cdot \frac{\frac{25}{2401}}{H} + v \cdot \frac{5}{49}\right)}{-1 \cdot H}\right)\right) \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v \cdot \left(\left(v \cdot \left(v \cdot v\right)\right) \cdot \frac{\frac{25}{2401}}{H} + v \cdot \frac{5}{49}\right)}{H \cdot -1}\right)\right) \]
            6. times-fracN/A

              \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{H} \cdot \frac{\left(v \cdot \left(v \cdot v\right)\right) \cdot \frac{\frac{25}{2401}}{H} + v \cdot \frac{5}{49}}{-1}\right)\right) \]
            7. *-lowering-*.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\left(\frac{v}{H}\right), \left(\frac{\left(v \cdot \left(v \cdot v\right)\right) \cdot \frac{\frac{25}{2401}}{H} + v \cdot \frac{5}{49}}{-1}\right)\right)\right) \]
            8. /-lowering-/.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(v, H\right), \left(\frac{\left(v \cdot \left(v \cdot v\right)\right) \cdot \frac{\frac{25}{2401}}{H} + v \cdot \frac{5}{49}}{-1}\right)\right)\right) \]
            9. /-lowering-/.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(v, H\right), \mathsf{/.f64}\left(\left(\left(v \cdot \left(v \cdot v\right)\right) \cdot \frac{\frac{25}{2401}}{H} + v \cdot \frac{5}{49}\right), -1\right)\right)\right) \]
          12. Applied egg-rr25.8%

            \[\leadsto \tan^{-1} \color{blue}{\left(\frac{v}{H} \cdot \frac{\frac{v \cdot \left(v \cdot v\right)}{\frac{H}{0.010412328196584756}} + v \cdot 0.10204081632653061}{-1}\right)} \]
          13. Taylor expanded in v around 0

            \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(v, H\right), \color{blue}{\left(\frac{-5}{49} \cdot v\right)}\right)\right) \]
          14. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(v, H\right), \left(v \cdot \frac{-5}{49}\right)\right)\right) \]
            2. *-lowering-*.f6425.8%

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(v, H\right), \mathsf{*.f64}\left(v, \frac{-5}{49}\right)\right)\right) \]
          15. Simplified25.8%

            \[\leadsto \tan^{-1} \left(\frac{v}{H} \cdot \color{blue}{\left(v \cdot -0.10204081632653061\right)}\right) \]

          if 1.4e-104 < v

          1. Initial program 57.4%

            \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
          2. Step-by-step derivation
            1. atan-lowering-atan.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
            3. sqrt-lowering-sqrt.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
            4. sub-negN/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
            5. +-lowering-+.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
            6. *-lowering-*.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
            8. distribute-rgt-neg-inN/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
            9. *-lowering-*.f64N/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
            10. metadata-evalN/A

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
            11. metadata-eval57.4%

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
          3. Simplified57.4%

            \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
          4. Add Preprocessing
          5. Taylor expanded in v around inf

            \[\leadsto \mathsf{atan.f64}\left(\color{blue}{1}\right) \]
          6. Step-by-step derivation
            1. Simplified88.0%

              \[\leadsto \tan^{-1} \color{blue}{1} \]
          7. Recombined 3 regimes into one program.
          8. Add Preprocessing

          Alternative 5: 72.9% accurate, 1.9× speedup?

          \[\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} \]
          (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}
          
          Derivation
          1. Split input into 2 regimes
          2. if v < 2e-273

            1. Initial program 69.4%

              \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
            2. Step-by-step derivation
              1. atan-lowering-atan.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
              3. sqrt-lowering-sqrt.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
              4. sub-negN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
              5. +-lowering-+.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
              7. *-commutativeN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
              8. distribute-rgt-neg-inN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
              9. *-lowering-*.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
              10. metadata-evalN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
              11. metadata-eval69.4%

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
            3. Simplified69.4%

              \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
            4. Add Preprocessing
            5. Taylor expanded in v around -inf

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \color{blue}{\left(-1 \cdot \left(v \cdot \left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right)\right)\right)}\right)\right) \]
            6. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\left(-1 \cdot v\right) \cdot \left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right)\right)\right)\right) \]
              2. *-commutativeN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right) \cdot \left(-1 \cdot v\right)\right)\right)\right) \]
              3. *-lowering-*.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{*.f64}\left(\left(1 + \left(\frac{-2401}{50} \cdot \frac{{H}^{2}}{{v}^{4}} + \frac{-49}{5} \cdot \frac{H}{{v}^{2}}\right)\right), \left(-1 \cdot v\right)\right)\right)\right) \]
            7. Simplified48.0%

              \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{\left(\left(1 + \frac{H}{v \cdot v} \cdot -9.8\right) + \frac{\left(H \cdot H\right) \cdot -48.02}{\left(v \cdot v\right) \cdot \left(v \cdot v\right)}\right) \cdot \left(0 - v\right)}}\right) \]
            8. Taylor expanded in H around 0

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \color{blue}{\left(-1 \cdot v + \frac{49}{5} \cdot \frac{H}{v}\right)}\right)\right) \]
            9. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{49}{5} \cdot \frac{H}{v} + -1 \cdot v\right)\right)\right) \]
              2. mul-1-negN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{49}{5} \cdot \frac{H}{v} + \left(\mathsf{neg}\left(v\right)\right)\right)\right)\right) \]
              3. unsub-negN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{49}{5} \cdot \frac{H}{v} - v\right)\right)\right) \]
              4. associate-*r/N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{\frac{49}{5} \cdot H}{v} - v\right)\right)\right) \]
              5. *-commutativeN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\frac{H \cdot \frac{49}{5}}{v} - v\right)\right)\right) \]
              6. associate-*r/N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(H \cdot \frac{\frac{49}{5}}{v} - v\right)\right)\right) \]
              7. metadata-evalN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(H \cdot \frac{\frac{49}{5} \cdot 1}{v} - v\right)\right)\right) \]
              8. associate-*r/N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(H \cdot \left(\frac{49}{5} \cdot \frac{1}{v}\right) - v\right)\right)\right) \]
              9. --lowering--.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(H \cdot \left(\frac{49}{5} \cdot \frac{1}{v}\right)\right), v\right)\right)\right) \]
              10. associate-*r/N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(H \cdot \frac{\frac{49}{5} \cdot 1}{v}\right), v\right)\right)\right) \]
              11. metadata-evalN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(H \cdot \frac{\frac{49}{5}}{v}\right), v\right)\right)\right) \]
              12. associate-*r/N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(\frac{H \cdot \frac{49}{5}}{v}\right), v\right)\right)\right) \]
              13. *-commutativeN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(\frac{\frac{49}{5} \cdot H}{v}\right), v\right)\right)\right) \]
              14. associate-*r/N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\left(\frac{49}{5} \cdot \frac{H}{v}\right), v\right)\right)\right) \]
              15. *-lowering-*.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{49}{5}, \left(\frac{H}{v}\right)\right), v\right)\right)\right) \]
              16. /-lowering-/.f6469.6%

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{49}{5}, \mathsf{/.f64}\left(H, v\right)\right), v\right)\right)\right) \]
            10. Simplified69.6%

              \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{9.8 \cdot \frac{H}{v} - v}}\right) \]

            if 2e-273 < v

            1. Initial program 64.8%

              \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
            2. Step-by-step derivation
              1. atan-lowering-atan.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
              3. sqrt-lowering-sqrt.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
              4. sub-negN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
              5. +-lowering-+.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
              7. *-commutativeN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
              8. distribute-rgt-neg-inN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
              9. *-lowering-*.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
              10. metadata-evalN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
              11. metadata-eval64.8%

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
            3. Simplified64.8%

              \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
            4. Add Preprocessing
            5. Taylor expanded in H around 0

              \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \color{blue}{\left(v + \frac{-49}{5} \cdot \frac{H}{v}\right)}\right)\right) \]
            6. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + \frac{H}{v} \cdot \frac{-49}{5}\right)\right)\right) \]
              2. associate-*l/N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + \frac{H \cdot \frac{-49}{5}}{v}\right)\right)\right) \]
              3. associate-*r/N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \frac{\frac{-49}{5}}{v}\right)\right)\right) \]
              4. metadata-evalN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \frac{\mathsf{neg}\left(\frac{49}{5}\right)}{v}\right)\right)\right) \]
              5. distribute-neg-fracN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5}}{v}\right)\right)\right)\right)\right) \]
              6. metadata-evalN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5} \cdot 1}{v}\right)\right)\right)\right)\right) \]
              7. associate-*r/N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{49}{5} \cdot \frac{1}{v}\right)\right)\right)\right)\right) \]
              8. +-lowering-+.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{49}{5} \cdot \frac{1}{v}\right)\right)\right)\right)\right)\right) \]
              9. associate-*r/N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5} \cdot 1}{v}\right)\right)\right)\right)\right)\right) \]
              10. metadata-evalN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5}}{v}\right)\right)\right)\right)\right)\right) \]
              11. distribute-neg-fracN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \frac{\mathsf{neg}\left(\frac{49}{5}\right)}{v}\right)\right)\right)\right) \]
              12. metadata-evalN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \frac{\frac{-49}{5}}{v}\right)\right)\right)\right) \]
              13. associate-*r/N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(\frac{H \cdot \frac{-49}{5}}{v}\right)\right)\right)\right) \]
              14. *-commutativeN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(\frac{\frac{-49}{5} \cdot H}{v}\right)\right)\right)\right) \]
              15. /-lowering-/.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\left(\frac{-49}{5} \cdot H\right), v\right)\right)\right)\right) \]
              16. *-commutativeN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\left(H \cdot \frac{-49}{5}\right), v\right)\right)\right)\right) \]
              17. *-lowering-*.f6473.9%

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\mathsf{*.f64}\left(H, \frac{-49}{5}\right), v\right)\right)\right)\right) \]
            7. Simplified73.9%

              \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{v + \frac{H \cdot -9.8}{v}}}\right) \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 6: 72.6% accurate, 1.9× speedup?

          \[\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} \]
          (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}
          
          Derivation
          1. Split input into 2 regimes
          2. if v < -2.34999999999999994e-147

            1. Initial program 59.1%

              \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
            2. Step-by-step derivation
              1. atan-lowering-atan.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
              3. sqrt-lowering-sqrt.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
              4. sub-negN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
              5. +-lowering-+.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
              7. *-commutativeN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
              8. distribute-rgt-neg-inN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
              9. *-lowering-*.f64N/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
              10. metadata-evalN/A

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
              11. metadata-eval59.1%

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
            3. Simplified59.1%

              \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
            4. Add Preprocessing
            5. Taylor expanded in v around -inf

              \[\leadsto \mathsf{atan.f64}\left(\color{blue}{-1}\right) \]
            6. Step-by-step derivation
              1. Simplified79.8%

                \[\leadsto \tan^{-1} \color{blue}{-1} \]

              if -2.34999999999999994e-147 < v

              1. Initial program 72.7%

                \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
              2. Step-by-step derivation
                1. atan-lowering-atan.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
                2. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
                3. sqrt-lowering-sqrt.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
                4. sub-negN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                5. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                7. *-commutativeN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                8. distribute-rgt-neg-inN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                9. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                10. metadata-evalN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
                11. metadata-eval72.7%

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
              3. Simplified72.7%

                \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
              4. Add Preprocessing
              5. Taylor expanded in H around 0

                \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \color{blue}{\left(v + \frac{-49}{5} \cdot \frac{H}{v}\right)}\right)\right) \]
              6. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + \frac{H}{v} \cdot \frac{-49}{5}\right)\right)\right) \]
                2. associate-*l/N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + \frac{H \cdot \frac{-49}{5}}{v}\right)\right)\right) \]
                3. associate-*r/N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \frac{\frac{-49}{5}}{v}\right)\right)\right) \]
                4. metadata-evalN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \frac{\mathsf{neg}\left(\frac{49}{5}\right)}{v}\right)\right)\right) \]
                5. distribute-neg-fracN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5}}{v}\right)\right)\right)\right)\right) \]
                6. metadata-evalN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5} \cdot 1}{v}\right)\right)\right)\right)\right) \]
                7. associate-*r/N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(v + H \cdot \left(\mathsf{neg}\left(\frac{49}{5} \cdot \frac{1}{v}\right)\right)\right)\right)\right) \]
                8. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{49}{5} \cdot \frac{1}{v}\right)\right)\right)\right)\right)\right) \]
                9. associate-*r/N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5} \cdot 1}{v}\right)\right)\right)\right)\right)\right) \]
                10. metadata-evalN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \left(\mathsf{neg}\left(\frac{\frac{49}{5}}{v}\right)\right)\right)\right)\right)\right) \]
                11. distribute-neg-fracN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \frac{\mathsf{neg}\left(\frac{49}{5}\right)}{v}\right)\right)\right)\right) \]
                12. metadata-evalN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(H \cdot \frac{\frac{-49}{5}}{v}\right)\right)\right)\right) \]
                13. associate-*r/N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(\frac{H \cdot \frac{-49}{5}}{v}\right)\right)\right)\right) \]
                14. *-commutativeN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \left(\frac{\frac{-49}{5} \cdot H}{v}\right)\right)\right)\right) \]
                15. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\left(\frac{-49}{5} \cdot H\right), v\right)\right)\right)\right) \]
                16. *-commutativeN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\left(H \cdot \frac{-49}{5}\right), v\right)\right)\right)\right) \]
                17. *-lowering-*.f6465.6%

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{+.f64}\left(v, \mathsf{/.f64}\left(\mathsf{*.f64}\left(H, \frac{-49}{5}\right), v\right)\right)\right)\right) \]
              7. Simplified65.6%

                \[\leadsto \tan^{-1} \left(\frac{v}{\color{blue}{v + \frac{H \cdot -9.8}{v}}}\right) \]
            7. Recombined 2 regimes into one program.
            8. Add Preprocessing

            Alternative 7: 68.5% accurate, 2.0× speedup?

            \[\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} \]
            (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}
            
            Derivation
            1. Split input into 2 regimes
            2. if v < -1.14999999999999998e-303

              1. Initial program 67.3%

                \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
              2. Step-by-step derivation
                1. atan-lowering-atan.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
                2. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
                3. sqrt-lowering-sqrt.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
                4. sub-negN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                5. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                7. *-commutativeN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                8. distribute-rgt-neg-inN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                9. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                10. metadata-evalN/A

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
                11. metadata-eval67.3%

                  \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
              3. Simplified67.3%

                \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
              4. Add Preprocessing
              5. Taylor expanded in v around -inf

                \[\leadsto \mathsf{atan.f64}\left(\color{blue}{-1}\right) \]
              6. Step-by-step derivation
                1. Simplified64.3%

                  \[\leadsto \tan^{-1} \color{blue}{-1} \]

                if -1.14999999999999998e-303 < v

                1. Initial program 67.2%

                  \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
                2. Step-by-step derivation
                  1. atan-lowering-atan.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
                  2. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
                  3. sqrt-lowering-sqrt.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
                  4. sub-negN/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                  5. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                  8. distribute-rgt-neg-inN/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
                  11. metadata-eval67.2%

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
                3. Simplified67.2%

                  \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
                4. Add Preprocessing
                5. Taylor expanded in v around inf

                  \[\leadsto \mathsf{atan.f64}\left(\color{blue}{1}\right) \]
                6. Step-by-step derivation
                  1. Simplified68.5%

                    \[\leadsto \tan^{-1} \color{blue}{1} \]
                7. Recombined 2 regimes into one program.
                8. Add Preprocessing

                Alternative 8: 35.2% accurate, 2.1× speedup?

                \[\begin{array}{l} \\ \tan^{-1} -1 \end{array} \]
                (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}
                
                Derivation
                1. Initial program 67.3%

                  \[\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot 9.8\right) \cdot H}}\right) \]
                2. Step-by-step derivation
                  1. atan-lowering-atan.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\left(\frac{v}{\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}}\right)\right) \]
                  2. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \left(\sqrt{v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H}\right)\right)\right) \]
                  3. sqrt-lowering-sqrt.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v - \left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right) \]
                  4. sub-negN/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\left(v \cdot v + \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                  5. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(v \cdot v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(\left(2 \cdot \frac{49}{5}\right) \cdot H\right)\right)\right)\right)\right)\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(\mathsf{neg}\left(H \cdot \left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                  8. distribute-rgt-neg-inN/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \left(H \cdot \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(2 \cdot \frac{49}{5}\right)\right)\right)\right)\right)\right)\right) \]
                  10. metadata-evalN/A

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \left(\mathsf{neg}\left(\frac{98}{5}\right)\right)\right)\right)\right)\right)\right) \]
                  11. metadata-eval67.3%

                    \[\leadsto \mathsf{atan.f64}\left(\mathsf{/.f64}\left(v, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(v, v\right), \mathsf{*.f64}\left(H, \frac{-98}{5}\right)\right)\right)\right)\right) \]
                3. Simplified67.3%

                  \[\leadsto \color{blue}{\tan^{-1} \left(\frac{v}{\sqrt{v \cdot v + H \cdot -19.6}}\right)} \]
                4. Add Preprocessing
                5. Taylor expanded in v around -inf

                  \[\leadsto \mathsf{atan.f64}\left(\color{blue}{-1}\right) \]
                6. Step-by-step derivation
                  1. Simplified33.1%

                    \[\leadsto \tan^{-1} \color{blue}{-1} \]
                  2. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2024138 
                  (FPCore (v H)
                    :name "Optimal throwing angle"
                    :precision binary64
                    (atan (/ v (sqrt (- (* v v) (* (* 2.0 9.8) H))))))