Rosa's DopplerBench

Percentage Accurate: 72.5% → 97.9%
Time: 16.9s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\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 15 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: 72.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Alternative 1: 97.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (* (/ (- t1) (+ t1 u)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 / (t1 + u)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (t1 + u));
}
def code(u, v, t1):
	return (-t1 / (t1 + u)) * (v / (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 / (t1 + u)) * (v / (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
\end{array}
Derivation
  1. Initial program 67.3%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac99.3%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    2. distribute-frac-neg99.3%

      \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
    3. distribute-neg-frac299.3%

      \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
    4. +-commutative99.3%

      \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
    5. distribute-neg-in99.3%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
    6. unsub-neg99.3%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
  3. Simplified99.3%

    \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Final simplification99.3%

    \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u} \]
  6. Add Preprocessing

Alternative 2: 90.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := v \cdot \frac{t1}{\left(\left(-u\right) - t1\right) \cdot \left(t1 + u\right)}\\ \mathbf{if}\;t1 \leq -1.3 \cdot 10^{+154}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \left(\frac{u}{t1} + -1\right)\\ \mathbf{elif}\;t1 \leq -5 \cdot 10^{-148}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 1.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\ \mathbf{elif}\;t1 \leq 6 \cdot 10^{+132}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* v (/ t1 (* (- (- u) t1) (+ t1 u))))))
   (if (<= t1 -1.3e+154)
     (* (/ v (+ t1 u)) (+ (/ u t1) -1.0))
     (if (<= t1 -5e-148)
       t_1
       (if (<= t1 1.5e-167)
         (* (/ t1 (- u)) (/ v u))
         (if (<= t1 6e+132) t_1 (/ v (- (- t1) (* u 2.0)))))))))
double code(double u, double v, double t1) {
	double t_1 = v * (t1 / ((-u - t1) * (t1 + u)));
	double tmp;
	if (t1 <= -1.3e+154) {
		tmp = (v / (t1 + u)) * ((u / t1) + -1.0);
	} else if (t1 <= -5e-148) {
		tmp = t_1;
	} else if (t1 <= 1.5e-167) {
		tmp = (t1 / -u) * (v / u);
	} else if (t1 <= 6e+132) {
		tmp = t_1;
	} else {
		tmp = v / (-t1 - (u * 2.0));
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = v * (t1 / ((-u - t1) * (t1 + u)))
    if (t1 <= (-1.3d+154)) then
        tmp = (v / (t1 + u)) * ((u / t1) + (-1.0d0))
    else if (t1 <= (-5d-148)) then
        tmp = t_1
    else if (t1 <= 1.5d-167) then
        tmp = (t1 / -u) * (v / u)
    else if (t1 <= 6d+132) then
        tmp = t_1
    else
        tmp = v / (-t1 - (u * 2.0d0))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = v * (t1 / ((-u - t1) * (t1 + u)));
	double tmp;
	if (t1 <= -1.3e+154) {
		tmp = (v / (t1 + u)) * ((u / t1) + -1.0);
	} else if (t1 <= -5e-148) {
		tmp = t_1;
	} else if (t1 <= 1.5e-167) {
		tmp = (t1 / -u) * (v / u);
	} else if (t1 <= 6e+132) {
		tmp = t_1;
	} else {
		tmp = v / (-t1 - (u * 2.0));
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = v * (t1 / ((-u - t1) * (t1 + u)))
	tmp = 0
	if t1 <= -1.3e+154:
		tmp = (v / (t1 + u)) * ((u / t1) + -1.0)
	elif t1 <= -5e-148:
		tmp = t_1
	elif t1 <= 1.5e-167:
		tmp = (t1 / -u) * (v / u)
	elif t1 <= 6e+132:
		tmp = t_1
	else:
		tmp = v / (-t1 - (u * 2.0))
	return tmp
function code(u, v, t1)
	t_1 = Float64(v * Float64(t1 / Float64(Float64(Float64(-u) - t1) * Float64(t1 + u))))
	tmp = 0.0
	if (t1 <= -1.3e+154)
		tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(u / t1) + -1.0));
	elseif (t1 <= -5e-148)
		tmp = t_1;
	elseif (t1 <= 1.5e-167)
		tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u));
	elseif (t1 <= 6e+132)
		tmp = t_1;
	else
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = v * (t1 / ((-u - t1) * (t1 + u)));
	tmp = 0.0;
	if (t1 <= -1.3e+154)
		tmp = (v / (t1 + u)) * ((u / t1) + -1.0);
	elseif (t1 <= -5e-148)
		tmp = t_1;
	elseif (t1 <= 1.5e-167)
		tmp = (t1 / -u) * (v / u);
	elseif (t1 <= 6e+132)
		tmp = t_1;
	else
		tmp = v / (-t1 - (u * 2.0));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v * N[(t1 / N[(N[((-u) - t1), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.3e+154], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(N[(u / t1), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -5e-148], t$95$1, If[LessEqual[t1, 1.5e-167], N[(N[(t1 / (-u)), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 6e+132], t$95$1, N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := v \cdot \frac{t1}{\left(\left(-u\right) - t1\right) \cdot \left(t1 + u\right)}\\
\mathbf{if}\;t1 \leq -1.3 \cdot 10^{+154}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \left(\frac{u}{t1} + -1\right)\\

\mathbf{elif}\;t1 \leq -5 \cdot 10^{-148}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq 1.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\

\mathbf{elif}\;t1 \leq 6 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t1 < -1.29999999999999994e154

    1. Initial program 48.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac100.0%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg100.0%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac2100.0%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative100.0%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 99.0%

      \[\leadsto \color{blue}{\left(\frac{u}{t1} - 1\right)} \cdot \frac{v}{t1 + u} \]

    if -1.29999999999999994e154 < t1 < -4.9999999999999999e-148 or 1.4999999999999999e-167 < t1 < 5.9999999999999996e132

    1. Initial program 81.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/89.4%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative89.4%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified89.4%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing

    if -4.9999999999999999e-148 < t1 < 1.4999999999999999e-167

    1. Initial program 74.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.3%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg97.3%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac297.3%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative97.3%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in97.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg97.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified97.3%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 87.8%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around 0 89.6%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    7. Step-by-step derivation
      1. associate-*r/89.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{u} \]
      2. mul-1-neg89.6%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{u} \]
    8. Simplified89.6%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{u} \]

    if 5.9999999999999996e132 < t1

    1. Initial program 40.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/43.9%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative43.9%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified43.9%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/40.4%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. times-frac100.0%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      3. *-commutative100.0%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg100.0%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg100.0%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative100.0%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg100.0%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times95.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity95.4%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative95.4%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in95.4%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg95.4%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
      16. sub-neg95.4%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      17. +-commutative95.4%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      18. add-sqr-sqrt0.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod36.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      20. sqr-neg36.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod35.3%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      22. add-sqr-sqrt10.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}\right)} \]
      23. sqrt-unprod35.3%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}\right)} \]
      24. sqr-neg35.3%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}\right)} \]
    6. Applied egg-rr95.4%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 90.4%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative90.4%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified90.4%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification91.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.3 \cdot 10^{+154}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \left(\frac{u}{t1} + -1\right)\\ \mathbf{elif}\;t1 \leq -5 \cdot 10^{-148}:\\ \;\;\;\;v \cdot \frac{t1}{\left(\left(-u\right) - t1\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;t1 \leq 1.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\ \mathbf{elif}\;t1 \leq 6 \cdot 10^{+132}:\\ \;\;\;\;v \cdot \frac{t1}{\left(\left(-u\right) - t1\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 90.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -9.2 \cdot 10^{+107}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \left(\frac{u}{t1} + -1\right)\\ \mathbf{elif}\;t1 \leq 3.4 \cdot 10^{+63}:\\ \;\;\;\;t1 \cdot \frac{\frac{-v}{t1 + u}}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -9.2e+107)
   (* (/ v (+ t1 u)) (+ (/ u t1) -1.0))
   (if (<= t1 3.4e+63)
     (* t1 (/ (/ (- v) (+ t1 u)) (+ t1 u)))
     (/ v (- (- t1) (* u 2.0))))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -9.2e+107) {
		tmp = (v / (t1 + u)) * ((u / t1) + -1.0);
	} else if (t1 <= 3.4e+63) {
		tmp = t1 * ((-v / (t1 + u)) / (t1 + u));
	} else {
		tmp = v / (-t1 - (u * 2.0));
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-9.2d+107)) then
        tmp = (v / (t1 + u)) * ((u / t1) + (-1.0d0))
    else if (t1 <= 3.4d+63) then
        tmp = t1 * ((-v / (t1 + u)) / (t1 + u))
    else
        tmp = v / (-t1 - (u * 2.0d0))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -9.2e+107) {
		tmp = (v / (t1 + u)) * ((u / t1) + -1.0);
	} else if (t1 <= 3.4e+63) {
		tmp = t1 * ((-v / (t1 + u)) / (t1 + u));
	} else {
		tmp = v / (-t1 - (u * 2.0));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -9.2e+107:
		tmp = (v / (t1 + u)) * ((u / t1) + -1.0)
	elif t1 <= 3.4e+63:
		tmp = t1 * ((-v / (t1 + u)) / (t1 + u))
	else:
		tmp = v / (-t1 - (u * 2.0))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -9.2e+107)
		tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(Float64(u / t1) + -1.0));
	elseif (t1 <= 3.4e+63)
		tmp = Float64(t1 * Float64(Float64(Float64(-v) / Float64(t1 + u)) / Float64(t1 + u)));
	else
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -9.2e+107)
		tmp = (v / (t1 + u)) * ((u / t1) + -1.0);
	elseif (t1 <= 3.4e+63)
		tmp = t1 * ((-v / (t1 + u)) / (t1 + u));
	else
		tmp = v / (-t1 - (u * 2.0));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -9.2e+107], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(N[(u / t1), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 3.4e+63], N[(t1 * N[(N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -9.2 \cdot 10^{+107}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \left(\frac{u}{t1} + -1\right)\\

\mathbf{elif}\;t1 \leq 3.4 \cdot 10^{+63}:\\
\;\;\;\;t1 \cdot \frac{\frac{-v}{t1 + u}}{t1 + u}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -9.2000000000000001e107

    1. Initial program 55.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac100.0%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg100.0%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac2100.0%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative100.0%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 99.2%

      \[\leadsto \color{blue}{\left(\frac{u}{t1} - 1\right)} \cdot \frac{v}{t1 + u} \]

    if -9.2000000000000001e107 < t1 < 3.3999999999999999e63

    1. Initial program 78.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/l*81.0%

        \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified81.0%

      \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/r*93.1%

        \[\leadsto \left(-t1\right) \cdot \color{blue}{\frac{\frac{v}{t1 + u}}{t1 + u}} \]
      2. div-inv93.0%

        \[\leadsto \left(-t1\right) \cdot \color{blue}{\left(\frac{v}{t1 + u} \cdot \frac{1}{t1 + u}\right)} \]
    6. Applied egg-rr93.0%

      \[\leadsto \left(-t1\right) \cdot \color{blue}{\left(\frac{v}{t1 + u} \cdot \frac{1}{t1 + u}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/93.1%

        \[\leadsto \left(-t1\right) \cdot \color{blue}{\frac{\frac{v}{t1 + u} \cdot 1}{t1 + u}} \]
      2. *-rgt-identity93.1%

        \[\leadsto \left(-t1\right) \cdot \frac{\color{blue}{\frac{v}{t1 + u}}}{t1 + u} \]
    8. Simplified93.1%

      \[\leadsto \left(-t1\right) \cdot \color{blue}{\frac{\frac{v}{t1 + u}}{t1 + u}} \]

    if 3.3999999999999999e63 < t1

    1. Initial program 51.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/57.4%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative57.4%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified57.4%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/51.3%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. times-frac100.0%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      3. *-commutative100.0%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg100.0%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg100.0%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative100.0%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg100.0%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times96.5%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity96.5%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative96.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in96.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg96.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
      16. sub-neg96.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      17. +-commutative96.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      18. add-sqr-sqrt0.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod38.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      20. sqr-neg38.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod38.2%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      22. add-sqr-sqrt14.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}\right)} \]
      23. sqrt-unprod38.2%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}\right)} \]
      24. sqr-neg38.2%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}\right)} \]
    6. Applied egg-rr96.5%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 92.5%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative92.5%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified92.5%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification94.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -9.2 \cdot 10^{+107}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \left(\frac{u}{t1} + -1\right)\\ \mathbf{elif}\;t1 \leq 3.4 \cdot 10^{+63}:\\ \;\;\;\;t1 \cdot \frac{\frac{-v}{t1 + u}}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.05 \cdot 10^{-63} \lor \neg \left(t1 \leq 1.82 \cdot 10^{+50}\right):\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -1.05e-63) (not (<= t1 1.82e+50)))
   (/ v (- (- t1) (* u 2.0)))
   (* (/ t1 (- u)) (/ v u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.05e-63) || !(t1 <= 1.82e+50)) {
		tmp = v / (-t1 - (u * 2.0));
	} else {
		tmp = (t1 / -u) * (v / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-1.05d-63)) .or. (.not. (t1 <= 1.82d+50))) then
        tmp = v / (-t1 - (u * 2.0d0))
    else
        tmp = (t1 / -u) * (v / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.05e-63) || !(t1 <= 1.82e+50)) {
		tmp = v / (-t1 - (u * 2.0));
	} else {
		tmp = (t1 / -u) * (v / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -1.05e-63) or not (t1 <= 1.82e+50):
		tmp = v / (-t1 - (u * 2.0))
	else:
		tmp = (t1 / -u) * (v / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -1.05e-63) || !(t1 <= 1.82e+50))
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	else
		tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -1.05e-63) || ~((t1 <= 1.82e+50)))
		tmp = v / (-t1 - (u * 2.0));
	else
		tmp = (t1 / -u) * (v / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.05e-63], N[Not[LessEqual[t1, 1.82e+50]], $MachinePrecision]], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / (-u)), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.05 \cdot 10^{-63} \lor \neg \left(t1 \leq 1.82 \cdot 10^{+50}\right):\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.05e-63 or 1.81999999999999997e50 < t1

    1. Initial program 57.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/62.9%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative62.9%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified62.9%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/57.2%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. times-frac99.9%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      3. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num99.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg99.9%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times96.6%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity96.6%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative96.6%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in96.6%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg96.6%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
      16. sub-neg96.6%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      17. +-commutative96.6%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      18. add-sqr-sqrt58.3%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod57.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      20. sqr-neg57.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod15.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      22. add-sqr-sqrt5.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}\right)} \]
      23. sqrt-unprod15.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}\right)} \]
      24. sqr-neg15.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}\right)} \]
    6. Applied egg-rr96.6%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 89.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative89.9%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified89.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]

    if -1.05e-63 < t1 < 1.81999999999999997e50

    1. Initial program 79.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.5%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg98.5%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac298.5%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative98.5%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in98.5%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg98.5%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.5%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 77.3%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around 0 80.6%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    7. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{u} \]
      2. mul-1-neg80.6%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{u} \]
    8. Simplified80.6%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{u} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.05 \cdot 10^{-63} \lor \neg \left(t1 \leq 1.82 \cdot 10^{+50}\right):\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 79.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -2 \cdot 10^{-64} \lor \neg \left(t1 \leq 2.4 \cdot 10^{+49}\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -2e-64) (not (<= t1 2.4e+49)))
   (/ (- v) (+ t1 u))
   (* (/ t1 (- u)) (/ v u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2e-64) || !(t1 <= 2.4e+49)) {
		tmp = -v / (t1 + u);
	} else {
		tmp = (t1 / -u) * (v / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-2d-64)) .or. (.not. (t1 <= 2.4d+49))) then
        tmp = -v / (t1 + u)
    else
        tmp = (t1 / -u) * (v / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2e-64) || !(t1 <= 2.4e+49)) {
		tmp = -v / (t1 + u);
	} else {
		tmp = (t1 / -u) * (v / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -2e-64) or not (t1 <= 2.4e+49):
		tmp = -v / (t1 + u)
	else:
		tmp = (t1 / -u) * (v / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -2e-64) || !(t1 <= 2.4e+49))
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	else
		tmp = Float64(Float64(t1 / Float64(-u)) * Float64(v / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -2e-64) || ~((t1 <= 2.4e+49)))
		tmp = -v / (t1 + u);
	else
		tmp = (t1 / -u) * (v / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2e-64], N[Not[LessEqual[t1, 2.4e+49]], $MachinePrecision]], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / (-u)), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2 \cdot 10^{-64} \lor \neg \left(t1 \leq 2.4 \cdot 10^{+49}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\

\mathbf{else}:\\
\;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.99999999999999993e-64 or 2.4e49 < t1

    1. Initial program 57.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 89.3%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. clear-num88.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
      2. un-div-inv88.9%

        \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
    7. Applied egg-rr88.9%

      \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
    8. Taylor expanded in v around 0 89.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1 + u}} \]
    9. Step-by-step derivation
      1. associate-*r/89.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1 + u}} \]
      2. mul-1-neg89.3%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    10. Simplified89.3%

      \[\leadsto \color{blue}{\frac{-v}{t1 + u}} \]

    if -1.99999999999999993e-64 < t1 < 2.4e49

    1. Initial program 79.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.5%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg98.5%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac298.5%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative98.5%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in98.5%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg98.5%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.5%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 77.3%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Taylor expanded in t1 around 0 80.6%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    7. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{u} \]
      2. mul-1-neg80.6%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{u} \]
    8. Simplified80.6%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{u} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -2 \cdot 10^{-64} \lor \neg \left(t1 \leq 2.4 \cdot 10^{+49}\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{-u} \cdot \frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 58.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.9 \cdot 10^{+171}:\\ \;\;\;\;\frac{v}{t1 + u}\\ \mathbf{elif}\;u \leq 3 \cdot 10^{+170}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{0.5}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.9e+171)
   (/ v (+ t1 u))
   (if (<= u 3e+170) (/ v (- t1)) (* v (/ 0.5 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.9e+171) {
		tmp = v / (t1 + u);
	} else if (u <= 3e+170) {
		tmp = v / -t1;
	} else {
		tmp = v * (0.5 / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-1.9d+171)) then
        tmp = v / (t1 + u)
    else if (u <= 3d+170) then
        tmp = v / -t1
    else
        tmp = v * (0.5d0 / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.9e+171) {
		tmp = v / (t1 + u);
	} else if (u <= 3e+170) {
		tmp = v / -t1;
	} else {
		tmp = v * (0.5 / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.9e+171:
		tmp = v / (t1 + u)
	elif u <= 3e+170:
		tmp = v / -t1
	else:
		tmp = v * (0.5 / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.9e+171)
		tmp = Float64(v / Float64(t1 + u));
	elseif (u <= 3e+170)
		tmp = Float64(v / Float64(-t1));
	else
		tmp = Float64(v * Float64(0.5 / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1.9e+171)
		tmp = v / (t1 + u);
	elseif (u <= 3e+170)
		tmp = v / -t1;
	else
		tmp = v * (0.5 / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.9e+171], N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 3e+170], N[(v / (-t1)), $MachinePrecision], N[(v * N[(0.5 / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.9 \cdot 10^{+171}:\\
\;\;\;\;\frac{v}{t1 + u}\\

\mathbf{elif}\;u \leq 3 \cdot 10^{+170}:\\
\;\;\;\;\frac{v}{-t1}\\

\mathbf{else}:\\
\;\;\;\;v \cdot \frac{0.5}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -1.9000000000000001e171

    1. Initial program 76.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.4%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.4%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.4%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.4%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 52.7%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/52.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1 + u}} \]
      2. neg-mul-152.7%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
      3. add-sqr-sqrt29.7%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1 + u} \]
      4. sqrt-unprod47.8%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1 + u} \]
      5. sqr-neg47.8%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{t1 + u} \]
      6. sqrt-unprod21.1%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1 + u} \]
      7. add-sqr-sqrt48.0%

        \[\leadsto \frac{\color{blue}{v}}{t1 + u} \]
    7. Applied egg-rr48.0%

      \[\leadsto \color{blue}{\frac{v}{t1 + u}} \]

    if -1.9000000000000001e171 < u < 2.99999999999999997e170

    1. Initial program 63.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/69.2%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative69.2%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified69.2%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 71.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/71.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-171.4%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified71.4%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if 2.99999999999999997e170 < u

    1. Initial program 82.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/82.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative82.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified82.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/82.4%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. times-frac99.9%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      3. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num99.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg99.8%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times86.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity86.0%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
      16. sub-neg86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      17. +-commutative86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      18. add-sqr-sqrt37.2%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod82.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      20. sqr-neg82.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      22. add-sqr-sqrt0.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}\right)} \]
      23. sqrt-unprod48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}\right)} \]
      24. sqr-neg48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}\right)} \]
    6. Applied egg-rr86.0%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 52.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative52.9%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified52.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Step-by-step derivation
      1. neg-sub052.9%

        \[\leadsto \frac{\color{blue}{0 - v}}{t1 + u \cdot 2} \]
      2. sub-neg52.9%

        \[\leadsto \frac{\color{blue}{0 + \left(-v\right)}}{t1 + u \cdot 2} \]
      3. add-sqr-sqrt20.0%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1 + u \cdot 2} \]
      4. sqrt-unprod50.4%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1 + u \cdot 2} \]
      5. sqr-neg50.4%

        \[\leadsto \frac{0 + \sqrt{\color{blue}{v \cdot v}}}{t1 + u \cdot 2} \]
      6. sqrt-unprod30.8%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1 + u \cdot 2} \]
      7. add-sqr-sqrt50.9%

        \[\leadsto \frac{0 + \color{blue}{v}}{t1 + u \cdot 2} \]
    11. Applied egg-rr50.9%

      \[\leadsto \frac{\color{blue}{0 + v}}{t1 + u \cdot 2} \]
    12. Step-by-step derivation
      1. +-lft-identity50.9%

        \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    13. Simplified50.9%

      \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    14. Taylor expanded in t1 around 0 51.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{v}{u}} \]
    15. Step-by-step derivation
      1. associate-*r/51.2%

        \[\leadsto \color{blue}{\frac{0.5 \cdot v}{u}} \]
      2. *-commutative51.2%

        \[\leadsto \frac{\color{blue}{v \cdot 0.5}}{u} \]
      3. associate-/l*51.2%

        \[\leadsto \color{blue}{v \cdot \frac{0.5}{u}} \]
    16. Simplified51.2%

      \[\leadsto \color{blue}{v \cdot \frac{0.5}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.9 \cdot 10^{+171}:\\ \;\;\;\;\frac{v}{t1 + u}\\ \mathbf{elif}\;u \leq 3 \cdot 10^{+170}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{0.5}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 58.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.9 \cdot 10^{+171}:\\ \;\;\;\;\frac{-0.5}{\frac{u}{v}}\\ \mathbf{elif}\;u \leq 1.36 \cdot 10^{+178}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{0.5}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -2.9e+171)
   (/ -0.5 (/ u v))
   (if (<= u 1.36e+178) (/ v (- t1)) (* v (/ 0.5 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.9e+171) {
		tmp = -0.5 / (u / v);
	} else if (u <= 1.36e+178) {
		tmp = v / -t1;
	} else {
		tmp = v * (0.5 / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-2.9d+171)) then
        tmp = (-0.5d0) / (u / v)
    else if (u <= 1.36d+178) then
        tmp = v / -t1
    else
        tmp = v * (0.5d0 / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.9e+171) {
		tmp = -0.5 / (u / v);
	} else if (u <= 1.36e+178) {
		tmp = v / -t1;
	} else {
		tmp = v * (0.5 / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -2.9e+171:
		tmp = -0.5 / (u / v)
	elif u <= 1.36e+178:
		tmp = v / -t1
	else:
		tmp = v * (0.5 / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -2.9e+171)
		tmp = Float64(-0.5 / Float64(u / v));
	elseif (u <= 1.36e+178)
		tmp = Float64(v / Float64(-t1));
	else
		tmp = Float64(v * Float64(0.5 / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -2.9e+171)
		tmp = -0.5 / (u / v);
	elseif (u <= 1.36e+178)
		tmp = v / -t1;
	else
		tmp = v * (0.5 / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -2.9e+171], N[(-0.5 / N[(u / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.36e+178], N[(v / (-t1)), $MachinePrecision], N[(v * N[(0.5 / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.9 \cdot 10^{+171}:\\
\;\;\;\;\frac{-0.5}{\frac{u}{v}}\\

\mathbf{elif}\;u \leq 1.36 \cdot 10^{+178}:\\
\;\;\;\;\frac{v}{-t1}\\

\mathbf{else}:\\
\;\;\;\;v \cdot \frac{0.5}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -2.89999999999999985e171

    1. Initial program 76.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/76.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative76.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified76.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/76.1%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. times-frac99.4%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      3. *-commutative99.4%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.4%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.4%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.4%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num97.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg97.8%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times81.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity81.9%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative81.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in81.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg81.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
      16. sub-neg81.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      17. +-commutative81.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      18. add-sqr-sqrt43.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod76.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      20. sqr-neg76.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod35.6%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      22. add-sqr-sqrt35.6%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}\right)} \]
      23. sqrt-unprod35.7%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}\right)} \]
      24. sqr-neg35.7%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}\right)} \]
    6. Applied egg-rr81.9%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 53.7%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative53.7%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified53.7%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Taylor expanded in t1 around 0 46.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{v}{u}} \]
    11. Step-by-step derivation
      1. *-commutative46.2%

        \[\leadsto \color{blue}{\frac{v}{u} \cdot -0.5} \]
    12. Simplified46.2%

      \[\leadsto \color{blue}{\frac{v}{u} \cdot -0.5} \]
    13. Step-by-step derivation
      1. *-commutative46.2%

        \[\leadsto \color{blue}{-0.5 \cdot \frac{v}{u}} \]
      2. clear-num46.5%

        \[\leadsto -0.5 \cdot \color{blue}{\frac{1}{\frac{u}{v}}} \]
      3. un-div-inv46.5%

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{u}{v}}} \]
    14. Applied egg-rr46.5%

      \[\leadsto \color{blue}{\frac{-0.5}{\frac{u}{v}}} \]

    if -2.89999999999999985e171 < u < 1.35999999999999992e178

    1. Initial program 63.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/69.2%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative69.2%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified69.2%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 71.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/71.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-171.4%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified71.4%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if 1.35999999999999992e178 < u

    1. Initial program 82.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/82.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative82.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified82.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/82.4%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. times-frac99.9%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      3. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num99.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg99.8%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times86.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity86.0%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
      16. sub-neg86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      17. +-commutative86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      18. add-sqr-sqrt37.2%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod82.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      20. sqr-neg82.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      22. add-sqr-sqrt0.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}\right)} \]
      23. sqrt-unprod48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}\right)} \]
      24. sqr-neg48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}\right)} \]
    6. Applied egg-rr86.0%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 52.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative52.9%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified52.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Step-by-step derivation
      1. neg-sub052.9%

        \[\leadsto \frac{\color{blue}{0 - v}}{t1 + u \cdot 2} \]
      2. sub-neg52.9%

        \[\leadsto \frac{\color{blue}{0 + \left(-v\right)}}{t1 + u \cdot 2} \]
      3. add-sqr-sqrt20.0%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1 + u \cdot 2} \]
      4. sqrt-unprod50.4%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1 + u \cdot 2} \]
      5. sqr-neg50.4%

        \[\leadsto \frac{0 + \sqrt{\color{blue}{v \cdot v}}}{t1 + u \cdot 2} \]
      6. sqrt-unprod30.8%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1 + u \cdot 2} \]
      7. add-sqr-sqrt50.9%

        \[\leadsto \frac{0 + \color{blue}{v}}{t1 + u \cdot 2} \]
    11. Applied egg-rr50.9%

      \[\leadsto \frac{\color{blue}{0 + v}}{t1 + u \cdot 2} \]
    12. Step-by-step derivation
      1. +-lft-identity50.9%

        \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    13. Simplified50.9%

      \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    14. Taylor expanded in t1 around 0 51.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{v}{u}} \]
    15. Step-by-step derivation
      1. associate-*r/51.2%

        \[\leadsto \color{blue}{\frac{0.5 \cdot v}{u}} \]
      2. *-commutative51.2%

        \[\leadsto \frac{\color{blue}{v \cdot 0.5}}{u} \]
      3. associate-/l*51.2%

        \[\leadsto \color{blue}{v \cdot \frac{0.5}{u}} \]
    16. Simplified51.2%

      \[\leadsto \color{blue}{v \cdot \frac{0.5}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.9 \cdot 10^{+171}:\\ \;\;\;\;\frac{-0.5}{\frac{u}{v}}\\ \mathbf{elif}\;u \leq 1.36 \cdot 10^{+178}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{0.5}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 58.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.72 \cdot 10^{+171}:\\ \;\;\;\;\frac{-1}{\frac{u}{v}}\\ \mathbf{elif}\;u \leq 2.65 \cdot 10^{+178}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{0.5}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.72e+171)
   (/ -1.0 (/ u v))
   (if (<= u 2.65e+178) (/ v (- t1)) (* v (/ 0.5 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.72e+171) {
		tmp = -1.0 / (u / v);
	} else if (u <= 2.65e+178) {
		tmp = v / -t1;
	} else {
		tmp = v * (0.5 / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-1.72d+171)) then
        tmp = (-1.0d0) / (u / v)
    else if (u <= 2.65d+178) then
        tmp = v / -t1
    else
        tmp = v * (0.5d0 / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.72e+171) {
		tmp = -1.0 / (u / v);
	} else if (u <= 2.65e+178) {
		tmp = v / -t1;
	} else {
		tmp = v * (0.5 / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.72e+171:
		tmp = -1.0 / (u / v)
	elif u <= 2.65e+178:
		tmp = v / -t1
	else:
		tmp = v * (0.5 / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.72e+171)
		tmp = Float64(-1.0 / Float64(u / v));
	elseif (u <= 2.65e+178)
		tmp = Float64(v / Float64(-t1));
	else
		tmp = Float64(v * Float64(0.5 / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1.72e+171)
		tmp = -1.0 / (u / v);
	elseif (u <= 2.65e+178)
		tmp = v / -t1;
	else
		tmp = v * (0.5 / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.72e+171], N[(-1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 2.65e+178], N[(v / (-t1)), $MachinePrecision], N[(v * N[(0.5 / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.72 \cdot 10^{+171}:\\
\;\;\;\;\frac{-1}{\frac{u}{v}}\\

\mathbf{elif}\;u \leq 2.65 \cdot 10^{+178}:\\
\;\;\;\;\frac{v}{-t1}\\

\mathbf{else}:\\
\;\;\;\;v \cdot \frac{0.5}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -1.7199999999999999e171

    1. Initial program 76.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.4%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.4%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.4%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.4%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 52.7%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. clear-num53.1%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
      2. un-div-inv53.1%

        \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
    7. Applied egg-rr53.1%

      \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
    8. Taylor expanded in t1 around 0 46.4%

      \[\leadsto \frac{-1}{\color{blue}{\frac{u}{v}}} \]

    if -1.7199999999999999e171 < u < 2.64999999999999994e178

    1. Initial program 63.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/69.2%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative69.2%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified69.2%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 71.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/71.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-171.4%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified71.4%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if 2.64999999999999994e178 < u

    1. Initial program 82.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/82.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative82.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified82.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/82.4%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. times-frac99.9%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      3. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num99.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg99.8%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times86.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity86.0%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
      16. sub-neg86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      17. +-commutative86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      18. add-sqr-sqrt37.2%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod82.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      20. sqr-neg82.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      22. add-sqr-sqrt0.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}\right)} \]
      23. sqrt-unprod48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}\right)} \]
      24. sqr-neg48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}\right)} \]
    6. Applied egg-rr86.0%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 52.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative52.9%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified52.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Step-by-step derivation
      1. neg-sub052.9%

        \[\leadsto \frac{\color{blue}{0 - v}}{t1 + u \cdot 2} \]
      2. sub-neg52.9%

        \[\leadsto \frac{\color{blue}{0 + \left(-v\right)}}{t1 + u \cdot 2} \]
      3. add-sqr-sqrt20.0%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1 + u \cdot 2} \]
      4. sqrt-unprod50.4%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1 + u \cdot 2} \]
      5. sqr-neg50.4%

        \[\leadsto \frac{0 + \sqrt{\color{blue}{v \cdot v}}}{t1 + u \cdot 2} \]
      6. sqrt-unprod30.8%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1 + u \cdot 2} \]
      7. add-sqr-sqrt50.9%

        \[\leadsto \frac{0 + \color{blue}{v}}{t1 + u \cdot 2} \]
    11. Applied egg-rr50.9%

      \[\leadsto \frac{\color{blue}{0 + v}}{t1 + u \cdot 2} \]
    12. Step-by-step derivation
      1. +-lft-identity50.9%

        \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    13. Simplified50.9%

      \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    14. Taylor expanded in t1 around 0 51.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{v}{u}} \]
    15. Step-by-step derivation
      1. associate-*r/51.2%

        \[\leadsto \color{blue}{\frac{0.5 \cdot v}{u}} \]
      2. *-commutative51.2%

        \[\leadsto \frac{\color{blue}{v \cdot 0.5}}{u} \]
      3. associate-/l*51.2%

        \[\leadsto \color{blue}{v \cdot \frac{0.5}{u}} \]
    16. Simplified51.2%

      \[\leadsto \color{blue}{v \cdot \frac{0.5}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.72 \cdot 10^{+171}:\\ \;\;\;\;\frac{-1}{\frac{u}{v}}\\ \mathbf{elif}\;u \leq 2.65 \cdot 10^{+178}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{0.5}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 58.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.55 \cdot 10^{+171}:\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \mathbf{elif}\;u \leq 3.4 \cdot 10^{+173}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{0.5}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -2.55e+171)
   (* (/ v u) -0.5)
   (if (<= u 3.4e+173) (/ v (- t1)) (* v (/ 0.5 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.55e+171) {
		tmp = (v / u) * -0.5;
	} else if (u <= 3.4e+173) {
		tmp = v / -t1;
	} else {
		tmp = v * (0.5 / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-2.55d+171)) then
        tmp = (v / u) * (-0.5d0)
    else if (u <= 3.4d+173) then
        tmp = v / -t1
    else
        tmp = v * (0.5d0 / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.55e+171) {
		tmp = (v / u) * -0.5;
	} else if (u <= 3.4e+173) {
		tmp = v / -t1;
	} else {
		tmp = v * (0.5 / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -2.55e+171:
		tmp = (v / u) * -0.5
	elif u <= 3.4e+173:
		tmp = v / -t1
	else:
		tmp = v * (0.5 / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -2.55e+171)
		tmp = Float64(Float64(v / u) * -0.5);
	elseif (u <= 3.4e+173)
		tmp = Float64(v / Float64(-t1));
	else
		tmp = Float64(v * Float64(0.5 / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -2.55e+171)
		tmp = (v / u) * -0.5;
	elseif (u <= 3.4e+173)
		tmp = v / -t1;
	else
		tmp = v * (0.5 / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -2.55e+171], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[u, 3.4e+173], N[(v / (-t1)), $MachinePrecision], N[(v * N[(0.5 / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.55 \cdot 10^{+171}:\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\

\mathbf{elif}\;u \leq 3.4 \cdot 10^{+173}:\\
\;\;\;\;\frac{v}{-t1}\\

\mathbf{else}:\\
\;\;\;\;v \cdot \frac{0.5}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -2.55000000000000011e171

    1. Initial program 76.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/76.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative76.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified76.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/76.1%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. times-frac99.4%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      3. *-commutative99.4%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.4%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.4%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.4%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num97.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg97.8%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times81.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity81.9%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative81.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in81.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg81.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
      16. sub-neg81.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      17. +-commutative81.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      18. add-sqr-sqrt43.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod76.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      20. sqr-neg76.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod35.6%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      22. add-sqr-sqrt35.6%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}\right)} \]
      23. sqrt-unprod35.7%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}\right)} \]
      24. sqr-neg35.7%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}\right)} \]
    6. Applied egg-rr81.9%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 53.7%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative53.7%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified53.7%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Taylor expanded in t1 around 0 46.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{v}{u}} \]
    11. Step-by-step derivation
      1. *-commutative46.2%

        \[\leadsto \color{blue}{\frac{v}{u} \cdot -0.5} \]
    12. Simplified46.2%

      \[\leadsto \color{blue}{\frac{v}{u} \cdot -0.5} \]

    if -2.55000000000000011e171 < u < 3.40000000000000021e173

    1. Initial program 63.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/69.2%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative69.2%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified69.2%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 71.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/71.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-171.4%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified71.4%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if 3.40000000000000021e173 < u

    1. Initial program 82.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/82.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative82.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified82.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/82.4%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. times-frac99.9%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      3. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num99.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg99.8%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times86.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity86.0%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
      16. sub-neg86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      17. +-commutative86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      18. add-sqr-sqrt37.2%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod82.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      20. sqr-neg82.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      22. add-sqr-sqrt0.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}\right)} \]
      23. sqrt-unprod48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}\right)} \]
      24. sqr-neg48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}\right)} \]
    6. Applied egg-rr86.0%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 52.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative52.9%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified52.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Step-by-step derivation
      1. neg-sub052.9%

        \[\leadsto \frac{\color{blue}{0 - v}}{t1 + u \cdot 2} \]
      2. sub-neg52.9%

        \[\leadsto \frac{\color{blue}{0 + \left(-v\right)}}{t1 + u \cdot 2} \]
      3. add-sqr-sqrt20.0%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1 + u \cdot 2} \]
      4. sqrt-unprod50.4%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1 + u \cdot 2} \]
      5. sqr-neg50.4%

        \[\leadsto \frac{0 + \sqrt{\color{blue}{v \cdot v}}}{t1 + u \cdot 2} \]
      6. sqrt-unprod30.8%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1 + u \cdot 2} \]
      7. add-sqr-sqrt50.9%

        \[\leadsto \frac{0 + \color{blue}{v}}{t1 + u \cdot 2} \]
    11. Applied egg-rr50.9%

      \[\leadsto \frac{\color{blue}{0 + v}}{t1 + u \cdot 2} \]
    12. Step-by-step derivation
      1. +-lft-identity50.9%

        \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    13. Simplified50.9%

      \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    14. Taylor expanded in t1 around 0 51.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{v}{u}} \]
    15. Step-by-step derivation
      1. associate-*r/51.2%

        \[\leadsto \color{blue}{\frac{0.5 \cdot v}{u}} \]
      2. *-commutative51.2%

        \[\leadsto \frac{\color{blue}{v \cdot 0.5}}{u} \]
      3. associate-/l*51.2%

        \[\leadsto \color{blue}{v \cdot \frac{0.5}{u}} \]
    16. Simplified51.2%

      \[\leadsto \color{blue}{v \cdot \frac{0.5}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.55 \cdot 10^{+171}:\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \mathbf{elif}\;u \leq 3.4 \cdot 10^{+173}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{0.5}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 58.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.2 \cdot 10^{+171}:\\ \;\;\;\;\frac{-v}{u}\\ \mathbf{elif}\;u \leq 1.7 \cdot 10^{+176}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{0.5}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.2e+171)
   (/ (- v) u)
   (if (<= u 1.7e+176) (/ v (- t1)) (* v (/ 0.5 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.2e+171) {
		tmp = -v / u;
	} else if (u <= 1.7e+176) {
		tmp = v / -t1;
	} else {
		tmp = v * (0.5 / u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-1.2d+171)) then
        tmp = -v / u
    else if (u <= 1.7d+176) then
        tmp = v / -t1
    else
        tmp = v * (0.5d0 / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.2e+171) {
		tmp = -v / u;
	} else if (u <= 1.7e+176) {
		tmp = v / -t1;
	} else {
		tmp = v * (0.5 / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.2e+171:
		tmp = -v / u
	elif u <= 1.7e+176:
		tmp = v / -t1
	else:
		tmp = v * (0.5 / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.2e+171)
		tmp = Float64(Float64(-v) / u);
	elseif (u <= 1.7e+176)
		tmp = Float64(v / Float64(-t1));
	else
		tmp = Float64(v * Float64(0.5 / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1.2e+171)
		tmp = -v / u;
	elseif (u <= 1.7e+176)
		tmp = v / -t1;
	else
		tmp = v * (0.5 / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.2e+171], N[((-v) / u), $MachinePrecision], If[LessEqual[u, 1.7e+176], N[(v / (-t1)), $MachinePrecision], N[(v * N[(0.5 / u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.2 \cdot 10^{+171}:\\
\;\;\;\;\frac{-v}{u}\\

\mathbf{elif}\;u \leq 1.7 \cdot 10^{+176}:\\
\;\;\;\;\frac{v}{-t1}\\

\mathbf{else}:\\
\;\;\;\;v \cdot \frac{0.5}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -1.19999999999999999e171

    1. Initial program 76.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.4%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.4%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.4%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.4%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 52.7%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Taylor expanded in t1 around 0 46.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{u}} \]
    7. Step-by-step derivation
      1. neg-mul-146.0%

        \[\leadsto \color{blue}{-\frac{v}{u}} \]
      2. distribute-neg-frac246.0%

        \[\leadsto \color{blue}{\frac{v}{-u}} \]
    8. Simplified46.0%

      \[\leadsto \color{blue}{\frac{v}{-u}} \]

    if -1.19999999999999999e171 < u < 1.70000000000000007e176

    1. Initial program 63.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/69.2%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative69.2%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified69.2%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 71.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/71.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-171.4%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified71.4%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if 1.70000000000000007e176 < u

    1. Initial program 82.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/82.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative82.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified82.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/82.4%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. times-frac99.9%

        \[\leadsto \color{blue}{\frac{v}{t1 + u} \cdot \frac{-t1}{t1 + u}} \]
      3. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num99.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg99.8%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times86.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity86.0%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
      16. sub-neg86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      17. +-commutative86.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      18. add-sqr-sqrt37.2%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod82.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      20. sqr-neg82.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      22. add-sqr-sqrt0.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}\right)} \]
      23. sqrt-unprod48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}\right)} \]
      24. sqr-neg48.8%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}\right)} \]
    6. Applied egg-rr86.0%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 52.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative52.9%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified52.9%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Step-by-step derivation
      1. neg-sub052.9%

        \[\leadsto \frac{\color{blue}{0 - v}}{t1 + u \cdot 2} \]
      2. sub-neg52.9%

        \[\leadsto \frac{\color{blue}{0 + \left(-v\right)}}{t1 + u \cdot 2} \]
      3. add-sqr-sqrt20.0%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1 + u \cdot 2} \]
      4. sqrt-unprod50.4%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1 + u \cdot 2} \]
      5. sqr-neg50.4%

        \[\leadsto \frac{0 + \sqrt{\color{blue}{v \cdot v}}}{t1 + u \cdot 2} \]
      6. sqrt-unprod30.8%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1 + u \cdot 2} \]
      7. add-sqr-sqrt50.9%

        \[\leadsto \frac{0 + \color{blue}{v}}{t1 + u \cdot 2} \]
    11. Applied egg-rr50.9%

      \[\leadsto \frac{\color{blue}{0 + v}}{t1 + u \cdot 2} \]
    12. Step-by-step derivation
      1. +-lft-identity50.9%

        \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    13. Simplified50.9%

      \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    14. Taylor expanded in t1 around 0 51.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{v}{u}} \]
    15. Step-by-step derivation
      1. associate-*r/51.2%

        \[\leadsto \color{blue}{\frac{0.5 \cdot v}{u}} \]
      2. *-commutative51.2%

        \[\leadsto \frac{\color{blue}{v \cdot 0.5}}{u} \]
      3. associate-/l*51.2%

        \[\leadsto \color{blue}{v \cdot \frac{0.5}{u}} \]
    16. Simplified51.2%

      \[\leadsto \color{blue}{v \cdot \frac{0.5}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.2 \cdot 10^{+171}:\\ \;\;\;\;\frac{-v}{u}\\ \mathbf{elif}\;u \leq 1.7 \cdot 10^{+176}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{0.5}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 23.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.8 \cdot 10^{+85} \lor \neg \left(t1 \leq 3.6 \cdot 10^{+130}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -1.8e+85) (not (<= t1 3.6e+130))) (/ v t1) (/ (- v) u)))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.8e+85) || !(t1 <= 3.6e+130)) {
		tmp = v / t1;
	} else {
		tmp = -v / u;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-1.8d+85)) .or. (.not. (t1 <= 3.6d+130))) then
        tmp = v / t1
    else
        tmp = -v / u
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.8e+85) || !(t1 <= 3.6e+130)) {
		tmp = v / t1;
	} else {
		tmp = -v / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -1.8e+85) or not (t1 <= 3.6e+130):
		tmp = v / t1
	else:
		tmp = -v / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -1.8e+85) || !(t1 <= 3.6e+130))
		tmp = Float64(v / t1);
	else
		tmp = Float64(Float64(-v) / u);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -1.8e+85) || ~((t1 <= 3.6e+130)))
		tmp = v / t1;
	else
		tmp = -v / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.8e+85], N[Not[LessEqual[t1, 3.6e+130]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[((-v) / u), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.8 \cdot 10^{+85} \lor \neg \left(t1 \leq 3.6 \cdot 10^{+130}\right):\\
\;\;\;\;\frac{v}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.7999999999999999e85 or 3.6000000000000001e130 < t1

    1. Initial program 49.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/54.0%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative54.0%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified54.0%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 94.7%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/94.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-194.7%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified94.7%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
    8. Step-by-step derivation
      1. neg-sub095.6%

        \[\leadsto \frac{\color{blue}{0 - v}}{t1 + u \cdot 2} \]
      2. sub-neg95.6%

        \[\leadsto \frac{\color{blue}{0 + \left(-v\right)}}{t1 + u \cdot 2} \]
      3. add-sqr-sqrt43.0%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1 + u \cdot 2} \]
      4. sqrt-unprod54.0%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1 + u \cdot 2} \]
      5. sqr-neg54.0%

        \[\leadsto \frac{0 + \sqrt{\color{blue}{v \cdot v}}}{t1 + u \cdot 2} \]
      6. sqrt-unprod21.0%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1 + u \cdot 2} \]
      7. add-sqr-sqrt41.4%

        \[\leadsto \frac{0 + \color{blue}{v}}{t1 + u \cdot 2} \]
    9. Applied egg-rr41.3%

      \[\leadsto \frac{\color{blue}{0 + v}}{t1} \]
    10. Step-by-step derivation
      1. +-lft-identity41.4%

        \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    11. Simplified41.3%

      \[\leadsto \frac{\color{blue}{v}}{t1} \]

    if -1.7999999999999999e85 < t1 < 3.6000000000000001e130

    1. Initial program 79.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.8%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg98.8%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac298.8%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative98.8%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in98.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg98.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.8%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 50.8%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Taylor expanded in t1 around 0 24.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{u}} \]
    7. Step-by-step derivation
      1. neg-mul-124.0%

        \[\leadsto \color{blue}{-\frac{v}{u}} \]
      2. distribute-neg-frac224.0%

        \[\leadsto \color{blue}{\frac{v}{-u}} \]
    8. Simplified24.0%

      \[\leadsto \color{blue}{\frac{v}{-u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.8 \cdot 10^{+85} \lor \neg \left(t1 \leq 3.6 \cdot 10^{+130}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 58.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.2 \cdot 10^{+171}:\\ \;\;\;\;\frac{-v}{u}\\ \mathbf{elif}\;u \leq 2 \cdot 10^{+175}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.2e+171) (/ (- v) u) (if (<= u 2e+175) (/ v (- t1)) (/ v u))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.2e+171) {
		tmp = -v / u;
	} else if (u <= 2e+175) {
		tmp = v / -t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-1.2d+171)) then
        tmp = -v / u
    else if (u <= 2d+175) then
        tmp = v / -t1
    else
        tmp = v / u
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.2e+171) {
		tmp = -v / u;
	} else if (u <= 2e+175) {
		tmp = v / -t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.2e+171:
		tmp = -v / u
	elif u <= 2e+175:
		tmp = v / -t1
	else:
		tmp = v / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.2e+171)
		tmp = Float64(Float64(-v) / u);
	elseif (u <= 2e+175)
		tmp = Float64(v / Float64(-t1));
	else
		tmp = Float64(v / u);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1.2e+171)
		tmp = -v / u;
	elseif (u <= 2e+175)
		tmp = v / -t1;
	else
		tmp = v / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.2e+171], N[((-v) / u), $MachinePrecision], If[LessEqual[u, 2e+175], N[(v / (-t1)), $MachinePrecision], N[(v / u), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.2 \cdot 10^{+171}:\\
\;\;\;\;\frac{-v}{u}\\

\mathbf{elif}\;u \leq 2 \cdot 10^{+175}:\\
\;\;\;\;\frac{v}{-t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -1.19999999999999999e171

    1. Initial program 76.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.4%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.4%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.4%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.4%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 52.7%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Taylor expanded in t1 around 0 46.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{u}} \]
    7. Step-by-step derivation
      1. neg-mul-146.0%

        \[\leadsto \color{blue}{-\frac{v}{u}} \]
      2. distribute-neg-frac246.0%

        \[\leadsto \color{blue}{\frac{v}{-u}} \]
    8. Simplified46.0%

      \[\leadsto \color{blue}{\frac{v}{-u}} \]

    if -1.19999999999999999e171 < u < 1.9999999999999999e175

    1. Initial program 63.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/69.2%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative69.2%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified69.2%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 71.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/71.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-171.4%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified71.4%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if 1.9999999999999999e175 < u

    1. Initial program 82.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 52.2%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/52.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1 + u}} \]
      2. neg-mul-152.2%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
      3. add-sqr-sqrt20.0%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1 + u} \]
      4. sqrt-unprod50.4%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1 + u} \]
      5. sqr-neg50.4%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{t1 + u} \]
      6. sqrt-unprod30.8%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1 + u} \]
      7. add-sqr-sqrt50.8%

        \[\leadsto \frac{\color{blue}{v}}{t1 + u} \]
    7. Applied egg-rr50.8%

      \[\leadsto \color{blue}{\frac{v}{t1 + u}} \]
    8. Taylor expanded in t1 around 0 51.1%

      \[\leadsto \color{blue}{\frac{v}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.2 \cdot 10^{+171}:\\ \;\;\;\;\frac{-v}{u}\\ \mathbf{elif}\;u \leq 2 \cdot 10^{+175}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 23.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -2.2 \cdot 10^{+80} \lor \neg \left(t1 \leq 1.6 \cdot 10^{+65}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -2.2e+80) (not (<= t1 1.6e+65))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.2e+80) || !(t1 <= 1.6e+65)) {
		tmp = v / t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-2.2d+80)) .or. (.not. (t1 <= 1.6d+65))) then
        tmp = v / t1
    else
        tmp = v / u
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.2e+80) || !(t1 <= 1.6e+65)) {
		tmp = v / t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -2.2e+80) or not (t1 <= 1.6e+65):
		tmp = v / t1
	else:
		tmp = v / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -2.2e+80) || !(t1 <= 1.6e+65))
		tmp = Float64(v / t1);
	else
		tmp = Float64(v / u);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -2.2e+80) || ~((t1 <= 1.6e+65)))
		tmp = v / t1;
	else
		tmp = v / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.2e+80], N[Not[LessEqual[t1, 1.6e+65]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.2 \cdot 10^{+80} \lor \neg \left(t1 \leq 1.6 \cdot 10^{+65}\right):\\
\;\;\;\;\frac{v}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -2.20000000000000003e80 or 1.60000000000000003e65 < t1

    1. Initial program 52.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/59.3%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative59.3%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified59.3%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 94.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/94.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-194.4%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified94.4%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
    8. Step-by-step derivation
      1. neg-sub096.0%

        \[\leadsto \frac{\color{blue}{0 - v}}{t1 + u \cdot 2} \]
      2. sub-neg96.0%

        \[\leadsto \frac{\color{blue}{0 + \left(-v\right)}}{t1 + u \cdot 2} \]
      3. add-sqr-sqrt44.2%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1 + u \cdot 2} \]
      4. sqrt-unprod54.9%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1 + u \cdot 2} \]
      5. sqr-neg54.9%

        \[\leadsto \frac{0 + \sqrt{\color{blue}{v \cdot v}}}{t1 + u \cdot 2} \]
      6. sqrt-unprod21.2%

        \[\leadsto \frac{0 + \color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1 + u \cdot 2} \]
      7. add-sqr-sqrt42.0%

        \[\leadsto \frac{0 + \color{blue}{v}}{t1 + u \cdot 2} \]
    9. Applied egg-rr41.1%

      \[\leadsto \frac{\color{blue}{0 + v}}{t1} \]
    10. Step-by-step derivation
      1. +-lft-identity42.0%

        \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
    11. Simplified41.1%

      \[\leadsto \frac{\color{blue}{v}}{t1} \]

    if -2.20000000000000003e80 < t1 < 1.60000000000000003e65

    1. Initial program 79.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.7%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg98.7%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac298.7%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative98.7%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in98.7%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg98.7%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.7%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 46.4%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/46.4%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1 + u}} \]
      2. neg-mul-146.4%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
      3. add-sqr-sqrt25.5%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1 + u} \]
      4. sqrt-unprod33.0%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1 + u} \]
      5. sqr-neg33.0%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{t1 + u} \]
      6. sqrt-unprod8.8%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1 + u} \]
      7. add-sqr-sqrt17.4%

        \[\leadsto \frac{\color{blue}{v}}{t1 + u} \]
    7. Applied egg-rr17.4%

      \[\leadsto \color{blue}{\frac{v}{t1 + u}} \]
    8. Taylor expanded in t1 around 0 20.4%

      \[\leadsto \color{blue}{\frac{v}{u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification29.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -2.2 \cdot 10^{+80} \lor \neg \left(t1 \leq 1.6 \cdot 10^{+65}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 61.6% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{-v}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (- v) (+ t1 u)))
double code(double u, double v, double t1) {
	return -v / (t1 + u);
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = -v / (t1 + u)
end function
public static double code(double u, double v, double t1) {
	return -v / (t1 + u);
}
def code(u, v, t1):
	return -v / (t1 + u)
function code(u, v, t1)
	return Float64(Float64(-v) / Float64(t1 + u))
end
function tmp = code(u, v, t1)
	tmp = -v / (t1 + u);
end
code[u_, v_, t1_] := N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-v}{t1 + u}
\end{array}
Derivation
  1. Initial program 67.3%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac99.3%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    2. distribute-frac-neg99.3%

      \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
    3. distribute-neg-frac299.3%

      \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
    4. +-commutative99.3%

      \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
    5. distribute-neg-in99.3%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
    6. unsub-neg99.3%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
  3. Simplified99.3%

    \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Taylor expanded in t1 around inf 68.0%

    \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
  6. Step-by-step derivation
    1. clear-num67.7%

      \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
    2. un-div-inv67.7%

      \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
  7. Applied egg-rr67.7%

    \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
  8. Taylor expanded in v around 0 68.0%

    \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1 + u}} \]
  9. Step-by-step derivation
    1. associate-*r/68.0%

      \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1 + u}} \]
    2. mul-1-neg68.0%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  10. Simplified68.0%

    \[\leadsto \color{blue}{\frac{-v}{t1 + u}} \]
  11. Add Preprocessing

Alternative 15: 14.5% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \frac{v}{t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ v t1))
double code(double u, double v, double t1) {
	return v / t1;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = v / t1
end function
public static double code(double u, double v, double t1) {
	return v / t1;
}
def code(u, v, t1):
	return v / t1
function code(u, v, t1)
	return Float64(v / t1)
end
function tmp = code(u, v, t1)
	tmp = v / t1;
end
code[u_, v_, t1_] := N[(v / t1), $MachinePrecision]
\begin{array}{l}

\\
\frac{v}{t1}
\end{array}
Derivation
  1. Initial program 67.3%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-*l/71.6%

      \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
    2. *-commutative71.6%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  3. Simplified71.6%

    \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in t1 around inf 61.2%

    \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
  6. Step-by-step derivation
    1. associate-*r/61.2%

      \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
    2. neg-mul-161.2%

      \[\leadsto \frac{\color{blue}{-v}}{t1} \]
  7. Simplified61.2%

    \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  8. Step-by-step derivation
    1. neg-sub068.6%

      \[\leadsto \frac{\color{blue}{0 - v}}{t1 + u \cdot 2} \]
    2. sub-neg68.6%

      \[\leadsto \frac{\color{blue}{0 + \left(-v\right)}}{t1 + u \cdot 2} \]
    3. add-sqr-sqrt33.9%

      \[\leadsto \frac{0 + \color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1 + u \cdot 2} \]
    4. sqrt-unprod42.7%

      \[\leadsto \frac{0 + \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1 + u \cdot 2} \]
    5. sqr-neg42.7%

      \[\leadsto \frac{0 + \sqrt{\color{blue}{v \cdot v}}}{t1 + u \cdot 2} \]
    6. sqrt-unprod14.3%

      \[\leadsto \frac{0 + \color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1 + u \cdot 2} \]
    7. add-sqr-sqrt28.3%

      \[\leadsto \frac{0 + \color{blue}{v}}{t1 + u \cdot 2} \]
  9. Applied egg-rr20.1%

    \[\leadsto \frac{\color{blue}{0 + v}}{t1} \]
  10. Step-by-step derivation
    1. +-lft-identity28.3%

      \[\leadsto \frac{\color{blue}{v}}{t1 + u \cdot 2} \]
  11. Simplified20.1%

    \[\leadsto \frac{\color{blue}{v}}{t1} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024160 
(FPCore (u v t1)
  :name "Rosa's DopplerBench"
  :precision binary64
  (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))