Rosa's DopplerBench

Percentage Accurate: 72.7% → 97.9%
Time: 8.8s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 72.7% 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 70.0%

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

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

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

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

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

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

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

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

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

Alternative 2: 89.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t1 \leq 1.45 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 47.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      8. 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)}} \]
      9. *-un-lft-identity100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e113 < t1 < 1.44999999999999998e-266 or 8.50000000000000047e112 < t1 < 6.1999999999999996e159

    1. Initial program 78.7%

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

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

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

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

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

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

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

    if 1.44999999999999998e-266 < t1 < 8.50000000000000047e112

    1. Initial program 87.2%

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

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

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

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

    if 6.1999999999999996e159 < t1

    1. Initial program 33.3%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -5 \cdot 10^{+113}:\\ \;\;\;\;\frac{v}{\left(-u \cdot 2\right) - t1}\\ \mathbf{elif}\;t1 \leq 1.45 \cdot 10^{-266}:\\ \;\;\;\;t1 \cdot \frac{\frac{-v}{t1 + u}}{t1 + u}\\ \mathbf{elif}\;t1 \leq 8.5 \cdot 10^{+112}:\\ \;\;\;\;v \cdot \frac{t1}{-\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;t1 \leq 6.2 \cdot 10^{+159}:\\ \;\;\;\;t1 \cdot \frac{\frac{-v}{t1 + u}}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 90.3% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 47.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      8. 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)}} \]
      9. *-un-lft-identity100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.89999999999999988e107 < t1 < 4.8999999999999996e159

    1. Initial program 82.1%

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

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

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

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

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

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

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

    if 4.8999999999999996e159 < t1

    1. Initial program 33.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 77.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.6 \cdot 10^{-60} \lor \neg \left(t1 \leq 1.45 \cdot 10^{-165}\right):\\
\;\;\;\;\frac{v}{\left(-u \cdot 2\right) - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -3.6e-60 or 1.45e-165 < t1

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6e-60 < t1 < 1.45e-165

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

Alternative 5: 76.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.9 \cdot 10^{-60} \lor \neg \left(t1 \leq 4.6 \cdot 10^{-167}\right):\\
\;\;\;\;\frac{v}{\left(-u \cdot 2\right) - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.89999999999999997e-60 or 4.6000000000000003e-167 < t1

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.89999999999999997e-60 < t1 < 4.6000000000000003e-167

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

Alternative 6: 67.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.25 \cdot 10^{-154} \lor \neg \left(t1 \leq 6.7 \cdot 10^{-168}\right):\\
\;\;\;\;\frac{v}{\left(-u \cdot 2\right) - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.25000000000000005e-154 or 6.69999999999999988e-168 < t1

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\frac{\color{blue}{t1 + u}}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      15. add-sqr-sqrt54.8%

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

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

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

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

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

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

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

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

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

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

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

    if -1.25000000000000005e-154 < t1 < 6.69999999999999988e-168

    1. Initial program 77.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t1 \cdot v}}{t1 \cdot u} \]
      3. *-commutative33.7%

        \[\leadsto \frac{-\color{blue}{v \cdot t1}}{t1 \cdot u} \]
      4. *-commutative33.7%

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

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

        \[\leadsto \frac{\frac{-\color{blue}{t1 \cdot v}}{u}}{t1} \]
      7. distribute-rgt-neg-in51.8%

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

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

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

        \[\leadsto \frac{\frac{t1 \cdot \sqrt{\color{blue}{v \cdot v}}}{u}}{t1} \]
      11. sqrt-unprod25.8%

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

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

      \[\leadsto \color{blue}{\frac{\frac{t1 \cdot v}{u}}{t1}} \]
    11. Step-by-step derivation
      1. *-commutative54.9%

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

        \[\leadsto \frac{\color{blue}{v \cdot \frac{t1}{u}}}{t1} \]
    12. Applied egg-rr60.0%

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

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

Alternative 7: 61.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5.4 \cdot 10^{-61} \lor \neg \left(t1 \leq 9.5 \cdot 10^{-166}\right):\\
\;\;\;\;\frac{-v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -5.39999999999999987e-61 or 9.50000000000000046e-166 < t1

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

    if -5.39999999999999987e-61 < t1 < 9.50000000000000046e-166

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-v \cdot t1}{u}}{t1}} \]
      6. *-commutative48.2%

        \[\leadsto \frac{\frac{-\color{blue}{t1 \cdot v}}{u}}{t1} \]
      7. distribute-rgt-neg-in48.2%

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

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

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

        \[\leadsto \frac{\frac{t1 \cdot \sqrt{\color{blue}{v \cdot v}}}{u}}{t1} \]
      11. sqrt-unprod27.8%

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

        \[\leadsto \frac{\frac{t1 \cdot \color{blue}{v}}{u}}{t1} \]
    10. Applied egg-rr51.6%

      \[\leadsto \color{blue}{\frac{\frac{t1 \cdot v}{u}}{t1}} \]
    11. Step-by-step derivation
      1. *-commutative51.6%

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

        \[\leadsto \frac{\color{blue}{v \cdot \frac{t1}{u}}}{t1} \]
    12. Applied egg-rr56.8%

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

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

Alternative 8: 64.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.6 \cdot 10^{+121} \lor \neg \left(u \leq 3.1 \cdot 10^{+113}\right):\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.5999999999999999e121 or 3.09999999999999991e113 < u

    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\color{blue}{u \cdot \frac{t1}{v}}} \]
    10. Simplified48.1%

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

        \[\leadsto \color{blue}{\frac{\frac{t1}{u}}{\frac{t1}{v}}} \]
      2. associate-/r/61.5%

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

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

    if -2.5999999999999999e121 < u < 3.09999999999999991e113

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 60.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.6 \cdot 10^{+109} \lor \neg \left(u \leq 1.45 \cdot 10^{+163}\right):\\
\;\;\;\;\frac{t1}{u} \cdot \frac{v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.5999999999999998e109 or 1.44999999999999999e163 < u

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\color{blue}{u \cdot \frac{t1}{v}}} \]
    10. Simplified52.4%

      \[\leadsto \frac{t1}{\color{blue}{u \cdot \frac{t1}{v}}} \]
    11. Step-by-step derivation
      1. *-un-lft-identity52.4%

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

        \[\leadsto \frac{1 \cdot t1}{\color{blue}{\frac{t1}{v} \cdot u}} \]
      3. times-frac59.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{t1}{v}} \cdot \frac{t1}{u}} \]
      4. clear-num59.2%

        \[\leadsto \color{blue}{\frac{v}{t1}} \cdot \frac{t1}{u} \]
    12. Applied egg-rr59.2%

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

    if -2.5999999999999998e109 < u < 1.44999999999999999e163

    1. Initial program 68.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 58.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.8 \cdot 10^{+192} \lor \neg \left(u \leq 1.15 \cdot 10^{+167}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.7999999999999999e192 or 1.14999999999999994e167 < u

    1. Initial program 79.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7999999999999999e192 < u < 1.14999999999999994e167

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 17.6% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \frac{v}{u} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ v u))
double code(double u, double v, double t1) {
	return v / 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 / u
end function
public static double code(double u, double v, double t1) {
	return v / u;
}
def code(u, v, t1):
	return v / u
function code(u, v, t1)
	return Float64(v / u)
end
function tmp = code(u, v, t1)
	tmp = v / u;
end
code[u_, v_, t1_] := N[(v / u), $MachinePrecision]
\begin{array}{l}

\\
\frac{v}{u}
\end{array}
Derivation
  1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{v}{u}} \]
  9. Add Preprocessing

Reproduce

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