Rosa's DopplerBench

Percentage Accurate: 73.3% → 97.9%
Time: 17.3s
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: 73.3% 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{-v}{t1 + u} \cdot \frac{t1}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (* (/ (- v) (+ t1 u)) (/ t1 (+ t1 u))))
double code(double u, double v, double t1) {
	return (-v / (t1 + u)) * (t1 / (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)) * (t1 / (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-v / (t1 + u)) * (t1 / (t1 + u));
}
def code(u, v, t1):
	return (-v / (t1 + u)) * (t1 / (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-v) / Float64(t1 + u)) * Float64(t1 / Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-v / (t1 + u)) * (t1 / (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\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. Final simplification98.8%

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

Alternative 2: 88.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-v\right) \cdot \frac{t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{if}\;t1 \leq -4.7 \cdot 10^{+141}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;t1 \leq -1.25 \cdot 10^{-109}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{-116}:\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{-v}}\\ \mathbf{elif}\;t1 \leq 6.2 \cdot 10^{+151}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot \left(u \cdot \frac{v}{t1}\right) - v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* (- v) (/ t1 (* (+ t1 u) (+ t1 u))))))
   (if (<= t1 -4.7e+141)
     (/ (- v) t1)
     (if (<= t1 -1.25e-109)
       t_1
       (if (<= t1 2.05e-116)
         (/ t1 (* u (/ u (- v))))
         (if (<= t1 6.2e+151) t_1 (/ (- (* 2.0 (* u (/ v t1))) v) t1)))))))
double code(double u, double v, double t1) {
	double t_1 = -v * (t1 / ((t1 + u) * (t1 + u)));
	double tmp;
	if (t1 <= -4.7e+141) {
		tmp = -v / t1;
	} else if (t1 <= -1.25e-109) {
		tmp = t_1;
	} else if (t1 <= 2.05e-116) {
		tmp = t1 / (u * (u / -v));
	} else if (t1 <= 6.2e+151) {
		tmp = t_1;
	} else {
		tmp = ((2.0 * (u * (v / t1))) - v) / t1;
	}
	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 / ((t1 + u) * (t1 + u)))
    if (t1 <= (-4.7d+141)) then
        tmp = -v / t1
    else if (t1 <= (-1.25d-109)) then
        tmp = t_1
    else if (t1 <= 2.05d-116) then
        tmp = t1 / (u * (u / -v))
    else if (t1 <= 6.2d+151) then
        tmp = t_1
    else
        tmp = ((2.0d0 * (u * (v / t1))) - v) / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -v * (t1 / ((t1 + u) * (t1 + u)));
	double tmp;
	if (t1 <= -4.7e+141) {
		tmp = -v / t1;
	} else if (t1 <= -1.25e-109) {
		tmp = t_1;
	} else if (t1 <= 2.05e-116) {
		tmp = t1 / (u * (u / -v));
	} else if (t1 <= 6.2e+151) {
		tmp = t_1;
	} else {
		tmp = ((2.0 * (u * (v / t1))) - v) / t1;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v * (t1 / ((t1 + u) * (t1 + u)))
	tmp = 0
	if t1 <= -4.7e+141:
		tmp = -v / t1
	elif t1 <= -1.25e-109:
		tmp = t_1
	elif t1 <= 2.05e-116:
		tmp = t1 / (u * (u / -v))
	elif t1 <= 6.2e+151:
		tmp = t_1
	else:
		tmp = ((2.0 * (u * (v / t1))) - v) / t1
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) * Float64(t1 / Float64(Float64(t1 + u) * Float64(t1 + u))))
	tmp = 0.0
	if (t1 <= -4.7e+141)
		tmp = Float64(Float64(-v) / t1);
	elseif (t1 <= -1.25e-109)
		tmp = t_1;
	elseif (t1 <= 2.05e-116)
		tmp = Float64(t1 / Float64(u * Float64(u / Float64(-v))));
	elseif (t1 <= 6.2e+151)
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(2.0 * Float64(u * Float64(v / t1))) - v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v * (t1 / ((t1 + u) * (t1 + u)));
	tmp = 0.0;
	if (t1 <= -4.7e+141)
		tmp = -v / t1;
	elseif (t1 <= -1.25e-109)
		tmp = t_1;
	elseif (t1 <= 2.05e-116)
		tmp = t1 / (u * (u / -v));
	elseif (t1 <= 6.2e+151)
		tmp = t_1;
	else
		tmp = ((2.0 * (u * (v / t1))) - v) / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) * N[(t1 / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -4.7e+141], N[((-v) / t1), $MachinePrecision], If[LessEqual[t1, -1.25e-109], t$95$1, If[LessEqual[t1, 2.05e-116], N[(t1 / N[(u * N[(u / (-v)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 6.2e+151], t$95$1, N[(N[(N[(2.0 * N[(u * N[(v / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision] / t1), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t1 \leq -1.25 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t1 \leq 6.2 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 54.9%

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

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

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

      \[\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 91.4%

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

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

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

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

    if -4.69999999999999979e141 < t1 < -1.25000000000000005e-109 or 2.0499999999999999e-116 < t1 < 6.2000000000000004e151

    1. Initial program 84.7%

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

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

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

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

    if -1.25000000000000005e-109 < t1 < 2.0499999999999999e-116

    1. Initial program 83.1%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Step-by-step derivation
      1. *-commutative90.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-t1}{\frac{u}{v} \cdot \left(0 - \left(\color{blue}{u} - t1\right)\right)} \]
      12. associate-+l-59.9%

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

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

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

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

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

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

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

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

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

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

    if 6.2000000000000004e151 < t1

    1. Initial program 38.8%

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

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

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

      \[\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 85.4%

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

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

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

        \[\leadsto \frac{\color{blue}{2 \cdot \frac{u \cdot v}{t1} - v}}{t1} \]
      4. associate-/l*89.5%

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

      \[\leadsto \color{blue}{\frac{2 \cdot \left(u \cdot \frac{v}{t1}\right) - v}{t1}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification92.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -4.7 \cdot 10^{+141}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;t1 \leq -1.25 \cdot 10^{-109}:\\ \;\;\;\;\left(-v\right) \cdot \frac{t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;t1 \leq 2.05 \cdot 10^{-116}:\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{-v}}\\ \mathbf{elif}\;t1 \leq 6.2 \cdot 10^{+151}:\\ \;\;\;\;\left(-v\right) \cdot \frac{t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot \left(u \cdot \frac{v}{t1}\right) - v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 90.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.5 \cdot 10^{+152}:\\ \;\;\;\;\frac{-v}{t1 + u \cdot 2}\\ \mathbf{elif}\;t1 \leq 2.7 \cdot 10^{+144}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot \left(u \cdot \frac{v}{t1}\right) - v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -1.5e+152)
   (/ (- v) (+ t1 (* u 2.0)))
   (if (<= t1 2.7e+144)
     (* t1 (/ (/ v (+ t1 u)) (- (- u) t1)))
     (/ (- (* 2.0 (* u (/ v t1))) v) t1))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -1.5e+152) {
		tmp = -v / (t1 + (u * 2.0));
	} else if (t1 <= 2.7e+144) {
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	} else {
		tmp = ((2.0 * (u * (v / t1))) - v) / t1;
	}
	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.5d+152)) then
        tmp = -v / (t1 + (u * 2.0d0))
    else if (t1 <= 2.7d+144) then
        tmp = t1 * ((v / (t1 + u)) / (-u - t1))
    else
        tmp = ((2.0d0 * (u * (v / t1))) - v) / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -1.5e+152) {
		tmp = -v / (t1 + (u * 2.0));
	} else if (t1 <= 2.7e+144) {
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	} else {
		tmp = ((2.0 * (u * (v / t1))) - v) / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -1.5e+152:
		tmp = -v / (t1 + (u * 2.0))
	elif t1 <= 2.7e+144:
		tmp = t1 * ((v / (t1 + u)) / (-u - t1))
	else:
		tmp = ((2.0 * (u * (v / t1))) - v) / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -1.5e+152)
		tmp = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0)));
	elseif (t1 <= 2.7e+144)
		tmp = Float64(t1 * Float64(Float64(v / Float64(t1 + u)) / Float64(Float64(-u) - t1)));
	else
		tmp = Float64(Float64(Float64(2.0 * Float64(u * Float64(v / t1))) - v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -1.5e+152)
		tmp = -v / (t1 + (u * 2.0));
	elseif (t1 <= 2.7e+144)
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	else
		tmp = ((2.0 * (u * (v / t1))) - v) / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -1.5e+152], N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2.7e+144], N[(t1 * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * N[(u * N[(v / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision] / t1), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;t1 \leq 2.7 \cdot 10^{+144}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\

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


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

    1. Initial program 53.9%

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

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

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified54.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/53.9%

        \[\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-times100.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-identity100.0%

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

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

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

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

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

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      18. add-sqr-sqrt99.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-unprod54.9%

        \[\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-neg54.9%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod0.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-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-unprod0.0%

        \[\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-neg0.0%

        \[\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-rr100.0%

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

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

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

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

    if -1.49999999999999995e152 < t1 < 2.70000000000000015e144

    1. Initial program 83.3%

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

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

      \[\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*95.3%

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

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

      \[\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/95.3%

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

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

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

    if 2.70000000000000015e144 < t1

    1. Initial program 38.8%

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

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

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

      \[\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 85.4%

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

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

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

        \[\leadsto \frac{\color{blue}{2 \cdot \frac{u \cdot v}{t1} - v}}{t1} \]
      4. associate-/l*89.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.5 \cdot 10^{+152}:\\ \;\;\;\;\frac{-v}{t1 + u \cdot 2}\\ \mathbf{elif}\;t1 \leq 2.7 \cdot 10^{+144}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot \left(u \cdot \frac{v}{t1}\right) - v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 85.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -2.9 \cdot 10^{+131}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;t1 \leq 4.8 \cdot 10^{+143}:\\ \;\;\;\;t1 \cdot \frac{-v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot \left(u \cdot \frac{v}{t1}\right) - v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -2.9e+131)
   (/ (- v) t1)
   (if (<= t1 4.8e+143)
     (* t1 (/ (- v) (* (+ t1 u) (+ t1 u))))
     (/ (- (* 2.0 (* u (/ v t1))) v) t1))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -2.9e+131) {
		tmp = -v / t1;
	} else if (t1 <= 4.8e+143) {
		tmp = t1 * (-v / ((t1 + u) * (t1 + u)));
	} else {
		tmp = ((2.0 * (u * (v / t1))) - v) / t1;
	}
	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.9d+131)) then
        tmp = -v / t1
    else if (t1 <= 4.8d+143) then
        tmp = t1 * (-v / ((t1 + u) * (t1 + u)))
    else
        tmp = ((2.0d0 * (u * (v / t1))) - v) / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -2.9e+131) {
		tmp = -v / t1;
	} else if (t1 <= 4.8e+143) {
		tmp = t1 * (-v / ((t1 + u) * (t1 + u)));
	} else {
		tmp = ((2.0 * (u * (v / t1))) - v) / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -2.9e+131:
		tmp = -v / t1
	elif t1 <= 4.8e+143:
		tmp = t1 * (-v / ((t1 + u) * (t1 + u)))
	else:
		tmp = ((2.0 * (u * (v / t1))) - v) / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -2.9e+131)
		tmp = Float64(Float64(-v) / t1);
	elseif (t1 <= 4.8e+143)
		tmp = Float64(t1 * Float64(Float64(-v) / Float64(Float64(t1 + u) * Float64(t1 + u))));
	else
		tmp = Float64(Float64(Float64(2.0 * Float64(u * Float64(v / t1))) - v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -2.9e+131)
		tmp = -v / t1;
	elseif (t1 <= 4.8e+143)
		tmp = t1 * (-v / ((t1 + u) * (t1 + u)));
	else
		tmp = ((2.0 * (u * (v / t1))) - v) / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -2.9e+131], N[((-v) / t1), $MachinePrecision], If[LessEqual[t1, 4.8e+143], N[(t1 * N[((-v) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * N[(u * N[(v / t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - v), $MachinePrecision] / t1), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.9 \cdot 10^{+131}:\\
\;\;\;\;\frac{-v}{t1}\\

\mathbf{elif}\;t1 \leq 4.8 \cdot 10^{+143}:\\
\;\;\;\;t1 \cdot \frac{-v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\

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


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

    1. Initial program 54.9%

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

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

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

      \[\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 91.4%

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

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

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

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

    if -2.9000000000000001e131 < t1 < 4.79999999999999959e143

    1. Initial program 83.9%

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

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

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

    if 4.79999999999999959e143 < t1

    1. Initial program 38.8%

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

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

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

      \[\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 85.4%

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

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

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

        \[\leadsto \frac{\color{blue}{2 \cdot \frac{u \cdot v}{t1} - v}}{t1} \]
      4. associate-/l*89.5%

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

      \[\leadsto \color{blue}{\frac{2 \cdot \left(u \cdot \frac{v}{t1}\right) - v}{t1}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification90.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -2.9 \cdot 10^{+131}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;t1 \leq 4.8 \cdot 10^{+143}:\\ \;\;\;\;t1 \cdot \frac{-v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot \left(u \cdot \frac{v}{t1}\right) - v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 77.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -2.05 \cdot 10^{+21}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;t1 \leq 9.2 \cdot 10^{-29}:\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{-v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u \cdot 2}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -2.05e+21)
   (/ (- v) t1)
   (if (<= t1 9.2e-29) (/ t1 (* u (/ u (- v)))) (/ (- v) (+ t1 (* u 2.0))))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -2.05e+21) {
		tmp = -v / t1;
	} else if (t1 <= 9.2e-29) {
		tmp = t1 / (u * (u / -v));
	} 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 <= (-2.05d+21)) then
        tmp = -v / t1
    else if (t1 <= 9.2d-29) then
        tmp = t1 / (u * (u / -v))
    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 <= -2.05e+21) {
		tmp = -v / t1;
	} else if (t1 <= 9.2e-29) {
		tmp = t1 / (u * (u / -v));
	} else {
		tmp = -v / (t1 + (u * 2.0));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -2.05e+21:
		tmp = -v / t1
	elif t1 <= 9.2e-29:
		tmp = t1 / (u * (u / -v))
	else:
		tmp = -v / (t1 + (u * 2.0))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -2.05e+21)
		tmp = Float64(Float64(-v) / t1);
	elseif (t1 <= 9.2e-29)
		tmp = Float64(t1 / Float64(u * Float64(u / Float64(-v))));
	else
		tmp = Float64(Float64(-v) / Float64(t1 + Float64(u * 2.0)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -2.05e+21)
		tmp = -v / t1;
	elseif (t1 <= 9.2e-29)
		tmp = t1 / (u * (u / -v));
	else
		tmp = -v / (t1 + (u * 2.0));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -2.05e+21], N[((-v) / t1), $MachinePrecision], If[LessEqual[t1, 9.2e-29], N[(t1 / N[(u * N[(u / (-v)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.05 \cdot 10^{+21}:\\
\;\;\;\;\frac{-v}{t1}\\

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

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


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

    1. Initial program 61.7%

      \[\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 87.9%

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

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

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

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

    if -2.05e21 < t1 < 9.19999999999999965e-29

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Step-by-step derivation
      1. *-commutative82.5%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-t1}{\frac{u}{v} \cdot \left(0 - \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)\right)} \]
      10. sqrt-unprod25.7%

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

        \[\leadsto \frac{-t1}{\frac{u}{v} \cdot \left(0 - \left(\color{blue}{u} - t1\right)\right)} \]
      12. associate-+l-54.5%

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

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

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

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

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

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

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

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

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

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

    if 9.19999999999999965e-29 < t1

    1. Initial program 62.6%

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

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

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

      \[\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/62.6%

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

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

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

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

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

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

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

        \[\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-times95.2%

        \[\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.2%

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

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

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

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

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

        \[\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.7%

        \[\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.7%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      21. sqrt-unprod38.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-sqrt15.7%

        \[\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-unprod26.6%

        \[\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-neg26.6%

        \[\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.2%

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

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

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

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

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

Alternative 6: 77.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -3.5 \cdot 10^{+24}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;t1 \leq 9 \cdot 10^{-29}:\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{-v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -3.5e+24)
   (/ (- v) t1)
   (if (<= t1 9e-29) (/ t1 (* u (/ u (- v)))) (/ (- v) (+ t1 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -3.5e+24) {
		tmp = -v / t1;
	} else if (t1 <= 9e-29) {
		tmp = t1 / (u * (u / -v));
	} else {
		tmp = -v / (t1 + 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 <= (-3.5d+24)) then
        tmp = -v / t1
    else if (t1 <= 9d-29) then
        tmp = t1 / (u * (u / -v))
    else
        tmp = -v / (t1 + u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -3.5e+24) {
		tmp = -v / t1;
	} else if (t1 <= 9e-29) {
		tmp = t1 / (u * (u / -v));
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -3.5e+24:
		tmp = -v / t1
	elif t1 <= 9e-29:
		tmp = t1 / (u * (u / -v))
	else:
		tmp = -v / (t1 + u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -3.5e+24)
		tmp = Float64(Float64(-v) / t1);
	elseif (t1 <= 9e-29)
		tmp = Float64(t1 / Float64(u * Float64(u / Float64(-v))));
	else
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -3.5e+24)
		tmp = -v / t1;
	elseif (t1 <= 9e-29)
		tmp = t1 / (u * (u / -v));
	else
		tmp = -v / (t1 + u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -3.5e+24], N[((-v) / t1), $MachinePrecision], If[LessEqual[t1, 9e-29], N[(t1 / N[(u * N[(u / (-v)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.5 \cdot 10^{+24}:\\
\;\;\;\;\frac{-v}{t1}\\

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

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


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

    1. Initial program 61.7%

      \[\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 87.9%

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

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

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

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

    if -3.5000000000000002e24 < t1 < 8.9999999999999996e-29

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{u}} \]
    6. Step-by-step derivation
      1. *-commutative82.5%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-t1}{\frac{u}{v} \cdot \left(0 - \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)\right)} \]
      10. sqrt-unprod25.7%

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

        \[\leadsto \frac{-t1}{\frac{u}{v} \cdot \left(0 - \left(\color{blue}{u} - t1\right)\right)} \]
      12. associate-+l-54.5%

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

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

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

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

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

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

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

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

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

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

    if 8.9999999999999996e-29 < t1

    1. Initial program 62.6%

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.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 77.7%

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

        \[\leadsto \color{blue}{-\frac{v}{t1 + u}} \]
      2. neg-sub077.7%

        \[\leadsto \color{blue}{0 - \frac{v}{t1 + u}} \]
      3. +-commutative77.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -3.5 \cdot 10^{+24}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;t1 \leq 9 \cdot 10^{-29}:\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{-v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 77.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -3 \cdot 10^{+25}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;t1 \leq 8.5 \cdot 10^{-29}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{u}}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -3e+25)
   (/ (- v) t1)
   (if (<= t1 8.5e-29) (* t1 (/ (/ v u) (- u))) (/ (- v) (+ t1 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -3e+25) {
		tmp = -v / t1;
	} else if (t1 <= 8.5e-29) {
		tmp = t1 * ((v / u) / -u);
	} else {
		tmp = -v / (t1 + 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 <= (-3d+25)) then
        tmp = -v / t1
    else if (t1 <= 8.5d-29) then
        tmp = t1 * ((v / u) / -u)
    else
        tmp = -v / (t1 + u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -3e+25) {
		tmp = -v / t1;
	} else if (t1 <= 8.5e-29) {
		tmp = t1 * ((v / u) / -u);
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -3e+25:
		tmp = -v / t1
	elif t1 <= 8.5e-29:
		tmp = t1 * ((v / u) / -u)
	else:
		tmp = -v / (t1 + u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -3e+25)
		tmp = Float64(Float64(-v) / t1);
	elseif (t1 <= 8.5e-29)
		tmp = Float64(t1 * Float64(Float64(v / u) / Float64(-u)));
	else
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -3e+25)
		tmp = -v / t1;
	elseif (t1 <= 8.5e-29)
		tmp = t1 * ((v / u) / -u);
	else
		tmp = -v / (t1 + u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -3e+25], N[((-v) / t1), $MachinePrecision], If[LessEqual[t1, 8.5e-29], N[(t1 * N[(N[(v / u), $MachinePrecision] / (-u)), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3 \cdot 10^{+25}:\\
\;\;\;\;\frac{-v}{t1}\\

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

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


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

    1. Initial program 61.7%

      \[\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 87.9%

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

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

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

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

    if -3.00000000000000006e25 < t1 < 8.5000000000000001e-29

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{u \cdot \left(t1 + u\right)}} \]
    7. Step-by-step derivation
      1. mul-1-neg73.1%

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

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

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

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

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

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

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

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

    if 8.5000000000000001e-29 < t1

    1. Initial program 62.6%

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.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 77.7%

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

        \[\leadsto \color{blue}{-\frac{v}{t1 + u}} \]
      2. neg-sub077.7%

        \[\leadsto \color{blue}{0 - \frac{v}{t1 + u}} \]
      3. +-commutative77.7%

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

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

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

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

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

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

Alternative 8: 75.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -3.75 \cdot 10^{+25}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;t1 \leq 9 \cdot 10^{-29}:\\ \;\;\;\;t1 \cdot \frac{-v}{u \cdot u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -3.75e+25)
   (/ (- v) t1)
   (if (<= t1 9e-29) (* t1 (/ (- v) (* u u))) (/ (- v) (+ t1 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -3.75e+25) {
		tmp = -v / t1;
	} else if (t1 <= 9e-29) {
		tmp = t1 * (-v / (u * u));
	} else {
		tmp = -v / (t1 + 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 <= (-3.75d+25)) then
        tmp = -v / t1
    else if (t1 <= 9d-29) then
        tmp = t1 * (-v / (u * u))
    else
        tmp = -v / (t1 + u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -3.75e+25) {
		tmp = -v / t1;
	} else if (t1 <= 9e-29) {
		tmp = t1 * (-v / (u * u));
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -3.75e+25:
		tmp = -v / t1
	elif t1 <= 9e-29:
		tmp = t1 * (-v / (u * u))
	else:
		tmp = -v / (t1 + u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -3.75e+25)
		tmp = Float64(Float64(-v) / t1);
	elseif (t1 <= 9e-29)
		tmp = Float64(t1 * Float64(Float64(-v) / Float64(u * u)));
	else
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -3.75e+25)
		tmp = -v / t1;
	elseif (t1 <= 9e-29)
		tmp = t1 * (-v / (u * u));
	else
		tmp = -v / (t1 + u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -3.75e+25], N[((-v) / t1), $MachinePrecision], If[LessEqual[t1, 9e-29], N[(t1 * N[((-v) / N[(u * u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.75 \cdot 10^{+25}:\\
\;\;\;\;\frac{-v}{t1}\\

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

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


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

    1. Initial program 61.7%

      \[\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 87.9%

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

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

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

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

    if -3.74999999999999996e25 < t1 < 8.9999999999999996e-29

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{u \cdot \left(t1 + u\right)}} \]
    7. Step-by-step derivation
      1. mul-1-neg73.1%

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

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

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

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

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

    if 8.9999999999999996e-29 < t1

    1. Initial program 62.6%

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.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 77.7%

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

        \[\leadsto \color{blue}{-\frac{v}{t1 + u}} \]
      2. neg-sub077.7%

        \[\leadsto \color{blue}{0 - \frac{v}{t1 + u}} \]
      3. +-commutative77.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -3.75 \cdot 10^{+25}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;t1 \leq 9 \cdot 10^{-29}:\\ \;\;\;\;t1 \cdot \frac{-v}{u \cdot u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 66.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.85 \cdot 10^{+84} \lor \neg \left(u \leq 0.25\right):\\
\;\;\;\;t1 \cdot \frac{\frac{v}{u}}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.85e84 or 0.25 < u

    1. Initial program 81.5%

      \[\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 0 87.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{u \cdot \left(t1 + u\right)}} \]
    7. Step-by-step derivation
      1. mul-1-neg79.3%

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

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

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

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

      \[\leadsto t1 \cdot \left(-\frac{v}{u \cdot \color{blue}{u}}\right) \]
    10. Step-by-step derivation
      1. add-sqr-sqrt66.3%

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

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

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

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

        \[\leadsto t1 \cdot \color{blue}{\frac{v}{u \cdot u}} \]
      6. associate-/r*67.5%

        \[\leadsto t1 \cdot \color{blue}{\frac{\frac{v}{u}}{u}} \]
    11. Applied egg-rr67.5%

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

    if -1.85e84 < u < 0.25

    1. Initial program 71.1%

      \[\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 69.3%

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

        \[\leadsto \color{blue}{-\frac{v}{t1 + u}} \]
      2. neg-sub069.3%

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

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

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

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

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

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

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

Alternative 10: 58.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.95 \cdot 10^{+72} \lor \neg \left(u \leq 4.8 \cdot 10^{+130}\right):\\ \;\;\;\;\frac{1}{\frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -2.95e+72) (not (<= u 4.8e+130))) (/ 1.0 (/ u v)) (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.95e+72) || !(u <= 4.8e+130)) {
		tmp = 1.0 / (u / v);
	} else {
		tmp = -v / t1;
	}
	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.95d+72)) .or. (.not. (u <= 4.8d+130))) then
        tmp = 1.0d0 / (u / v)
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.95e+72) || !(u <= 4.8e+130)) {
		tmp = 1.0 / (u / v);
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -2.95e+72) or not (u <= 4.8e+130):
		tmp = 1.0 / (u / v)
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -2.95e+72) || !(u <= 4.8e+130))
		tmp = Float64(1.0 / Float64(u / v));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -2.95e+72) || ~((u <= 4.8e+130)))
		tmp = 1.0 / (u / v);
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.95e+72], N[Not[LessEqual[u, 4.8e+130]], $MachinePrecision]], N[(1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.95 \cdot 10^{+72} \lor \neg \left(u \leq 4.8 \cdot 10^{+130}\right):\\
\;\;\;\;\frac{1}{\frac{u}{v}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.9500000000000001e72 or 4.80000000000000048e130 < u

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    8. Simplified29.3%

      \[\leadsto \color{blue}{\frac{-v}{u}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt13.3%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{u} \]
      2. sqrt-unprod31.2%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{u} \]
      3. sqr-neg31.2%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{u} \]
      4. sqrt-unprod16.1%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{u} \]
      5. add-sqr-sqrt29.7%

        \[\leadsto \frac{\color{blue}{v}}{u} \]
      6. clear-num31.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{v}}} \]
      7. inv-pow31.7%

        \[\leadsto \color{blue}{{\left(\frac{u}{v}\right)}^{-1}} \]
    10. Applied egg-rr31.7%

      \[\leadsto \color{blue}{{\left(\frac{u}{v}\right)}^{-1}} \]
    11. Step-by-step derivation
      1. unpow-131.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{v}}} \]
    12. Simplified31.7%

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

    if -2.9500000000000001e72 < u < 4.80000000000000048e130

    1. Initial program 73.8%

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

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

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

      \[\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 64.3%

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

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

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

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

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

Alternative 11: 58.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.8 \cdot 10^{+170} \lor \neg \left(u \leq 7.2 \cdot 10^{+131}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.80000000000000015e170 or 7.20000000000000063e131 < u

    1. Initial program 77.1%

      \[\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 inf 34.8%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{u}} \]
      2. mul-1-neg31.9%

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    8. Simplified31.9%

      \[\leadsto \color{blue}{\frac{-v}{u}} \]
    9. Step-by-step derivation
      1. div-inv31.9%

        \[\leadsto \color{blue}{\left(-v\right) \cdot \frac{1}{u}} \]
      2. add-sqr-sqrt13.5%

        \[\leadsto \color{blue}{\left(\sqrt{-v} \cdot \sqrt{-v}\right)} \cdot \frac{1}{u} \]
      3. sqrt-unprod31.7%

        \[\leadsto \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}} \cdot \frac{1}{u} \]
      4. sqr-neg31.7%

        \[\leadsto \sqrt{\color{blue}{v \cdot v}} \cdot \frac{1}{u} \]
      5. sqrt-unprod18.5%

        \[\leadsto \color{blue}{\left(\sqrt{v} \cdot \sqrt{v}\right)} \cdot \frac{1}{u} \]
      6. add-sqr-sqrt32.4%

        \[\leadsto \color{blue}{v} \cdot \frac{1}{u} \]
    10. Applied egg-rr32.4%

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

        \[\leadsto \color{blue}{\frac{v \cdot 1}{u}} \]
      2. *-rgt-identity32.4%

        \[\leadsto \frac{\color{blue}{v}}{u} \]
    12. Simplified32.4%

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

    if -2.80000000000000015e170 < u < 7.20000000000000063e131

    1. Initial program 75.3%

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

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

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

      \[\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 59.3%

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

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

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

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

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

Alternative 12: 22.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -6.5 \cdot 10^{+29} \lor \neg \left(t1 \leq 9.2 \cdot 10^{+167}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -6.5e+29) (not (<= t1 9.2e+167))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -6.5e+29) || !(t1 <= 9.2e+167)) {
		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 <= (-6.5d+29)) .or. (.not. (t1 <= 9.2d+167))) 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 <= -6.5e+29) || !(t1 <= 9.2e+167)) {
		tmp = v / t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -6.5e+29) or not (t1 <= 9.2e+167):
		tmp = v / t1
	else:
		tmp = v / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -6.5e+29) || !(t1 <= 9.2e+167))
		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 <= -6.5e+29) || ~((t1 <= 9.2e+167)))
		tmp = v / t1;
	else
		tmp = v / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -6.5e+29], N[Not[LessEqual[t1, 9.2e+167]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -6.5 \cdot 10^{+29} \lor \neg \left(t1 \leq 9.2 \cdot 10^{+167}\right):\\
\;\;\;\;\frac{v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -6.49999999999999971e29 or 9.19999999999999952e167 < t1

    1. Initial program 52.7%

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

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

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

      \[\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 88.8%

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

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

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

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

        \[\leadsto \frac{\color{blue}{0 - v}}{t1} \]
      2. sub-neg88.8%

        \[\leadsto \frac{\color{blue}{0 + \left(-v\right)}}{t1} \]
      3. add-sqr-sqrt38.4%

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

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

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

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

        \[\leadsto \frac{0 + \color{blue}{v}}{t1} \]
    9. Applied egg-rr36.6%

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

        \[\leadsto \frac{\color{blue}{v}}{t1} \]
    11. Simplified36.6%

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

    if -6.49999999999999971e29 < t1 < 9.19999999999999952e167

    1. Initial program 85.1%

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.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 40.4%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{u}} \]
      2. mul-1-neg16.8%

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

      \[\leadsto \color{blue}{\frac{-v}{u}} \]
    9. Step-by-step derivation
      1. div-inv16.8%

        \[\leadsto \color{blue}{\left(-v\right) \cdot \frac{1}{u}} \]
      2. add-sqr-sqrt7.8%

        \[\leadsto \color{blue}{\left(\sqrt{-v} \cdot \sqrt{-v}\right)} \cdot \frac{1}{u} \]
      3. sqrt-unprod23.9%

        \[\leadsto \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}} \cdot \frac{1}{u} \]
      4. sqr-neg23.9%

        \[\leadsto \sqrt{\color{blue}{v \cdot v}} \cdot \frac{1}{u} \]
      5. sqrt-unprod8.6%

        \[\leadsto \color{blue}{\left(\sqrt{v} \cdot \sqrt{v}\right)} \cdot \frac{1}{u} \]
      6. add-sqr-sqrt17.5%

        \[\leadsto \color{blue}{v} \cdot \frac{1}{u} \]
    10. Applied egg-rr17.5%

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

        \[\leadsto \color{blue}{\frac{v \cdot 1}{u}} \]
      2. *-rgt-identity17.5%

        \[\leadsto \frac{\color{blue}{v}}{u} \]
    12. Simplified17.5%

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

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

Alternative 13: 39.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;v \leq 1.05 \cdot 10^{-221}:\\ \;\;\;\;\frac{v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= v 1.05e-221) (/ v (+ t1 u)) (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if (v <= 1.05e-221) {
		tmp = v / (t1 + u);
	} else {
		tmp = -v / t1;
	}
	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 (v <= 1.05d-221) then
        tmp = v / (t1 + u)
    else
        tmp = -v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (v <= 1.05e-221) {
		tmp = v / (t1 + u);
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if v <= 1.05e-221:
		tmp = v / (t1 + u)
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (v <= 1.05e-221)
		tmp = Float64(v / Float64(t1 + u));
	else
		tmp = Float64(Float64(-v) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (v <= 1.05e-221)
		tmp = v / (t1 + u);
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[v, 1.05e-221], N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if v < 1.05e-221

    1. Initial program 77.1%

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.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 56.4%

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

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

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

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

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

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

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

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

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

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

    if 1.05e-221 < v

    1. Initial program 74.2%

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

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

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified77.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 49.6%

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

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

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

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

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

Alternative 14: 62.1% 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 75.8%

    \[\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 54.3%

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

      \[\leadsto \color{blue}{-\frac{v}{t1 + u}} \]
    2. neg-sub054.3%

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

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

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

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

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

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

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

Alternative 15: 14.1% 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 75.8%

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

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

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

    \[\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 46.1%

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

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

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

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

      \[\leadsto \frac{\color{blue}{0 - v}}{t1} \]
    2. sub-neg46.1%

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{v}}{t1} \]
  11. Simplified12.2%

    \[\leadsto \frac{\color{blue}{v}}{t1} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024170 
(FPCore (u v t1)
  :name "Rosa's DopplerBench"
  :precision binary64
  (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))