Rosa's DopplerBench

Percentage Accurate: 72.6% → 98.0%
Time: 13.4s
Alternatives: 14
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 14 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.6% 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: 98.0% accurate, 1.0× speedup?

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

\\
\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}
\end{array}
Derivation
  1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.3% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 35.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999921e133 < t1 < 1.24999999999999994e157

    1. Initial program 84.4%

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

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

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

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

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

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

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

    if 1.24999999999999994e157 < t1

    1. Initial program 46.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 77.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -8.5 \cdot 10^{+56} \lor \neg \left(u \leq 1.4 \cdot 10^{-74}\right):\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{-u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -8.4999999999999998e56 or 1.39999999999999994e-74 < u

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999998e56 < u < 1.39999999999999994e-74

    1. Initial program 63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 77.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{v}{t1 + u}\\
\mathbf{if}\;u \leq -5.4 \cdot 10^{+56}:\\
\;\;\;\;\frac{t\_1}{\frac{u}{-t1}}\\

\mathbf{elif}\;u \leq 1.15 \cdot 10^{-74}:\\
\;\;\;\;\frac{v}{u \cdot \left(-2\right) - t1}\\

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


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

    1. Initial program 78.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{t1}} \cdot \frac{v}{t1 + u}} \]
      4. metadata-eval97.9%

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

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

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

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

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

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

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

    if -5.40000000000000019e56 < u < 1.1499999999999999e-74

    1. Initial program 63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1499999999999999e-74 < u

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 76.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.4 \cdot 10^{+56} \lor \neg \left(u \leq 1.4 \cdot 10^{-74}\right):\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -5.40000000000000019e56 or 1.39999999999999994e-74 < u

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{u \cdot \left(t1 + u\right)}} \]
    11. Step-by-step derivation
      1. *-commutative78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{t1 \cdot \frac{v}{u}}}{t1 - u} \]
    17. Simplified87.2%

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

    if -5.40000000000000019e56 < u < 1.39999999999999994e-74

    1. Initial program 63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 79.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -6.2 \cdot 10^{-37} \lor \neg \left(t1 \leq 2.6 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{v}{\left(-u\right) - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -6.19999999999999987e-37 or 2.5999999999999998e-16 < t1

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.19999999999999987e-37 < t1 < 2.5999999999999998e-16

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 79.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7.5 \cdot 10^{-37} \lor \neg \left(t1 \leq 2.6 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{v}{u \cdot \left(-2\right) - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -7.5000000000000004e-37 or 2.5999999999999998e-16 < t1

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5000000000000004e-37 < t1 < 2.5999999999999998e-16

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 57.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -4.19999999999999982e57 or 1e129 < u

    1. Initial program 78.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot t1}{t1 + u}} \cdot \frac{v}{t1} \]
      4. *-lft-identity55.5%

        \[\leadsto \frac{\color{blue}{t1}}{t1 + u} \cdot \frac{v}{t1} \]
      5. times-frac49.8%

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

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

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

        \[\leadsto \color{blue}{1} \cdot \frac{v}{t1 + u} \]
      9. *-lft-identity47.5%

        \[\leadsto \color{blue}{\frac{v}{t1 + u}} \]
    9. Simplified47.5%

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

    if -4.19999999999999982e57 < u < 1e129

    1. Initial program 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 58.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.8 \cdot 10^{+138} \lor \neg \left(u \leq 10^{+151}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -5.80000000000000019e138 or 1.00000000000000002e151 < u

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    8. Step-by-step derivation
      1. mul-1-neg48.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{v} \cdot \frac{1}{t1 + u} \]
      7. *-commutative46.5%

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

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

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

    if -5.80000000000000019e138 < u < 1.00000000000000002e151

    1. Initial program 70.1%

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

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

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

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

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

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

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

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

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.2 \cdot 10^{+138} \lor \neg \left(u \leq 3.2 \cdot 10^{+142}\right):\\
\;\;\;\;\frac{v}{-u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.2000000000000001e138 or 3.20000000000000005e142 < u

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

    if -2.2000000000000001e138 < u < 3.20000000000000005e142

    1. Initial program 70.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 23.2% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -9.0000000000000007e121 or 1.60000000000000006e63 < t1

    1. Initial program 45.9%

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000007e121 < t1 < 1.60000000000000006e63

    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    10. Step-by-step derivation
      1. div-inv48.6%

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

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

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

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

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

        \[\leadsto \color{blue}{v} \cdot \frac{1}{t1 + u} \]
      7. *-commutative21.7%

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

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

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

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

Alternative 12: 98.0% accurate, 1.0× speedup?

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

\\
\frac{t1}{t1 + u} \cdot \frac{v}{\left(-u\right) - t1}
\end{array}
Derivation
  1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

Alternative 13: 61.2% accurate, 2.0× speedup?

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

\\
\frac{v}{\left(-u\right) - t1}
\end{array}
Derivation
  1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{v}{\left(-u\right) - t1} \]
  11. Add Preprocessing

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  7. Final simplification16.2%

    \[\leadsto \frac{v}{t1} \]
  8. Add Preprocessing

Reproduce

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