Rosa's DopplerBench

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

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

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

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

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

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

Alternative 2: 77.2% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1 \cdot 10^{-11}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if u < -9.99999999999999939e-12

    1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999939e-12 < u < 3.5999999999999998e-23

    1. Initial program 59.8%

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

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

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

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

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

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

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

    if 3.5999999999999998e-23 < u < 5.0000000000000004e43

    1. Initial program 78.5%

      \[\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}} \]
    3. Simplified99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000004e43 < u < 8.99999999999999953e120

    1. Initial program 60.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.99999999999999953e120 < u

    1. Initial program 66.0%

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1 \cdot 10^{-11}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\ \mathbf{elif}\;u \leq 3.6 \cdot 10^{-23}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;u \leq 5 \cdot 10^{+43}:\\ \;\;\;\;\frac{v}{t1 - u} \cdot \frac{t1}{u}\\ \mathbf{elif}\;u \leq 9 \cdot 10^{+120}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{v}{t1 + u}}{\frac{t1 - u}{t1}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 76.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{v}{u} \cdot \frac{t1}{t1 - u}\\ \mathbf{if}\;u \leq -8.2 \cdot 10^{-13}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;u \leq 2.8 \cdot 10^{-25}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;u \leq 1.05 \cdot 10^{+44} \lor \neg \left(u \leq 9 \cdot 10^{+120}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* (/ v u) (/ t1 (- t1 u)))))
   (if (<= u -8.2e-13)
     t_1
     (if (<= u 2.8e-25)
       (/ (- v) t1)
       (if (or (<= u 1.05e+44) (not (<= u 9e+120)))
         t_1
         (/ v (- (* u -2.0) t1)))))))
double code(double u, double v, double t1) {
	double t_1 = (v / u) * (t1 / (t1 - u));
	double tmp;
	if (u <= -8.2e-13) {
		tmp = t_1;
	} else if (u <= 2.8e-25) {
		tmp = -v / t1;
	} else if ((u <= 1.05e+44) || !(u <= 9e+120)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (v / u) * (t1 / (t1 - u))
    if (u <= (-8.2d-13)) then
        tmp = t_1
    else if (u <= 2.8d-25) then
        tmp = -v / t1
    else if ((u <= 1.05d+44) .or. (.not. (u <= 9d+120))) then
        tmp = t_1
    else
        tmp = v / ((u * (-2.0d0)) - t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = (v / u) * (t1 / (t1 - u));
	double tmp;
	if (u <= -8.2e-13) {
		tmp = t_1;
	} else if (u <= 2.8e-25) {
		tmp = -v / t1;
	} else if ((u <= 1.05e+44) || !(u <= 9e+120)) {
		tmp = t_1;
	} else {
		tmp = v / ((u * -2.0) - t1);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = (v / u) * (t1 / (t1 - u))
	tmp = 0
	if u <= -8.2e-13:
		tmp = t_1
	elif u <= 2.8e-25:
		tmp = -v / t1
	elif (u <= 1.05e+44) or not (u <= 9e+120):
		tmp = t_1
	else:
		tmp = v / ((u * -2.0) - t1)
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(v / u) * Float64(t1 / Float64(t1 - u)))
	tmp = 0.0
	if (u <= -8.2e-13)
		tmp = t_1;
	elseif (u <= 2.8e-25)
		tmp = Float64(Float64(-v) / t1);
	elseif ((u <= 1.05e+44) || !(u <= 9e+120))
		tmp = t_1;
	else
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = (v / u) * (t1 / (t1 - u));
	tmp = 0.0;
	if (u <= -8.2e-13)
		tmp = t_1;
	elseif (u <= 2.8e-25)
		tmp = -v / t1;
	elseif ((u <= 1.05e+44) || ~((u <= 9e+120)))
		tmp = t_1;
	else
		tmp = v / ((u * -2.0) - t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(v / u), $MachinePrecision] * N[(t1 / N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -8.2e-13], t$95$1, If[LessEqual[u, 2.8e-25], N[((-v) / t1), $MachinePrecision], If[Or[LessEqual[u, 1.05e+44], N[Not[LessEqual[u, 9e+120]], $MachinePrecision]], t$95$1, N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;u \leq 1.05 \cdot 10^{+44} \lor \neg \left(u \leq 9 \cdot 10^{+120}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -8.2000000000000004e-13 or 2.79999999999999988e-25 < u < 1.04999999999999993e44 or 8.99999999999999953e120 < u

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t1}{\frac{u}{v} \cdot \left(t1 - u\right)}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity79.2%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{v}} \cdot \frac{t1}{t1 - u}} \]
      3. clear-num80.5%

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

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

    if -8.2000000000000004e-13 < u < 2.79999999999999988e-25

    1. Initial program 59.8%

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

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

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

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

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

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

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

    if 1.04999999999999993e44 < u < 8.99999999999999953e120

    1. Initial program 60.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -8.2 \cdot 10^{-13}:\\ \;\;\;\;\frac{v}{u} \cdot \frac{t1}{t1 - u}\\ \mathbf{elif}\;u \leq 2.8 \cdot 10^{-25}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;u \leq 1.05 \cdot 10^{+44} \lor \neg \left(u \leq 9 \cdot 10^{+120}\right):\\ \;\;\;\;\frac{v}{u} \cdot \frac{t1}{t1 - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 77.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{v}{t1 - u} \cdot \frac{t1}{u}\\ \mathbf{if}\;u \leq -2.9 \cdot 10^{-12}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;u \leq 1.4 \cdot 10^{-22}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;u \leq 2.5 \cdot 10^{+43} \lor \neg \left(u \leq 1.55 \cdot 10^{+121}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* (/ v (- t1 u)) (/ t1 u))))
   (if (<= u -2.9e-12)
     t_1
     (if (<= u 1.4e-22)
       (/ (- v) t1)
       (if (or (<= u 2.5e+43) (not (<= u 1.55e+121)))
         t_1
         (/ v (- (* u -2.0) t1)))))))
double code(double u, double v, double t1) {
	double t_1 = (v / (t1 - u)) * (t1 / u);
	double tmp;
	if (u <= -2.9e-12) {
		tmp = t_1;
	} else if (u <= 1.4e-22) {
		tmp = -v / t1;
	} else if ((u <= 2.5e+43) || !(u <= 1.55e+121)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (v / (t1 - u)) * (t1 / u)
    if (u <= (-2.9d-12)) then
        tmp = t_1
    else if (u <= 1.4d-22) then
        tmp = -v / t1
    else if ((u <= 2.5d+43) .or. (.not. (u <= 1.55d+121))) then
        tmp = t_1
    else
        tmp = v / ((u * (-2.0d0)) - t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = (v / (t1 - u)) * (t1 / u);
	double tmp;
	if (u <= -2.9e-12) {
		tmp = t_1;
	} else if (u <= 1.4e-22) {
		tmp = -v / t1;
	} else if ((u <= 2.5e+43) || !(u <= 1.55e+121)) {
		tmp = t_1;
	} else {
		tmp = v / ((u * -2.0) - t1);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = (v / (t1 - u)) * (t1 / u)
	tmp = 0
	if u <= -2.9e-12:
		tmp = t_1
	elif u <= 1.4e-22:
		tmp = -v / t1
	elif (u <= 2.5e+43) or not (u <= 1.55e+121):
		tmp = t_1
	else:
		tmp = v / ((u * -2.0) - t1)
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(v / Float64(t1 - u)) * Float64(t1 / u))
	tmp = 0.0
	if (u <= -2.9e-12)
		tmp = t_1;
	elseif (u <= 1.4e-22)
		tmp = Float64(Float64(-v) / t1);
	elseif ((u <= 2.5e+43) || !(u <= 1.55e+121))
		tmp = t_1;
	else
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = (v / (t1 - u)) * (t1 / u);
	tmp = 0.0;
	if (u <= -2.9e-12)
		tmp = t_1;
	elseif (u <= 1.4e-22)
		tmp = -v / t1;
	elseif ((u <= 2.5e+43) || ~((u <= 1.55e+121)))
		tmp = t_1;
	else
		tmp = v / ((u * -2.0) - t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[(v / N[(t1 - u), $MachinePrecision]), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -2.9e-12], t$95$1, If[LessEqual[u, 1.4e-22], N[((-v) / t1), $MachinePrecision], If[Or[LessEqual[u, 2.5e+43], N[Not[LessEqual[u, 1.55e+121]], $MachinePrecision]], t$95$1, N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;u \leq 2.5 \cdot 10^{+43} \lor \neg \left(u \leq 1.55 \cdot 10^{+121}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -2.9000000000000002e-12 or 1.39999999999999997e-22 < u < 2.5000000000000002e43 or 1.55000000000000004e121 < u

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9000000000000002e-12 < u < 1.39999999999999997e-22

    1. Initial program 59.8%

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

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

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

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

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

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

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

    if 2.5000000000000002e43 < u < 1.55000000000000004e121

    1. Initial program 60.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.9 \cdot 10^{-12}:\\ \;\;\;\;\frac{v}{t1 - u} \cdot \frac{t1}{u}\\ \mathbf{elif}\;u \leq 1.4 \cdot 10^{-22}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;u \leq 2.5 \cdot 10^{+43} \lor \neg \left(u \leq 1.55 \cdot 10^{+121}\right):\\ \;\;\;\;\frac{v}{t1 - u} \cdot \frac{t1}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 77.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;u \leq 3.8 \cdot 10^{+43} \lor \neg \left(u \leq 9 \cdot 10^{+120}\right):\\
\;\;\;\;\frac{v}{t1 - u} \cdot \frac{t1}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if u < -4.39999999999999983e-12

    1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.39999999999999983e-12 < u < 8.79999999999999948e-27

    1. Initial program 59.8%

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

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

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

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

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

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

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

    if 8.79999999999999948e-27 < u < 3.80000000000000008e43 or 8.99999999999999953e120 < u

    1. Initial program 70.6%

      \[\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}} \]
    3. Simplified99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.80000000000000008e43 < u < 8.99999999999999953e120

    1. Initial program 60.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -4.4 \cdot 10^{-12}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\ \mathbf{elif}\;u \leq 8.8 \cdot 10^{-27}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;u \leq 3.8 \cdot 10^{+43} \lor \neg \left(u \leq 9 \cdot 10^{+120}\right):\\ \;\;\;\;\frac{v}{t1 - u} \cdot \frac{t1}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 57.7% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 76.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{v}{\color{blue}{u \cdot -2 - t1}} \]
    8. Taylor expanded in u around inf 46.8%

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

    if -1.30000000000000011e142 < u < 1.7200000000000001e168

    1. Initial program 65.8%

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

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

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

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

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

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

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

    if 1.7200000000000001e168 < u

    1. Initial program 69.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 57.6% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.45000000000000007e142 or 2.2e191 < u

    1. Initial program 74.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45000000000000007e142 < u < 2.2e191

    1. Initial program 65.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    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 simplification61.3%

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

Alternative 8: 57.6% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 76.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}} \]
    3. Simplified99.9%

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

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

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

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

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

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

    if -1.4e142 < u < 2.7999999999999999e191

    1. Initial program 65.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    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}} \]

    if 2.7999999999999999e191 < u

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 57.6% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 76.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{v}{\color{blue}{u \cdot -2 - t1}} \]
    8. Taylor expanded in u around inf 46.8%

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

    if -2.7000000000000001e141 < u < 2.39999999999999986e191

    1. Initial program 65.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    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}} \]

    if 2.39999999999999986e191 < u

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.7 \cdot 10^{+141}:\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \mathbf{elif}\;u \leq 2.4 \cdot 10^{+191}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 61.0% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < 3.4e196

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

    if 3.4e196 < u

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 61.4% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < 3.4e196

    1. Initial program 67.2%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{v}{\frac{t1 + u}{-t1}}}}{t1 + u} \]
      4. associate-/l/95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.4e196 < u

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 20.2% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 32.4%

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{v}{t1 + u}}{\frac{t1 - u}{t1}}} \]
    9. Taylor expanded in t1 around inf 21.0%

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

    if -9.80000000000000064e131 < t1

    1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 60.9% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 14.3% accurate, 4.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. clear-num98.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{v}{\frac{\color{blue}{t1 - u}}{-\left(-t1\right)} \cdot \left(t1 + u\right)} \]
    12. remove-double-neg48.1%

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{v}{t1 + u}}{\frac{t1 - u}{t1}}} \]
  9. Taylor expanded in t1 around inf 8.4%

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  10. Final simplification8.4%

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

Reproduce

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