Rosa's DopplerBench

Percentage Accurate: 72.1% → 98.3%
Time: 9.6s
Alternatives: 13
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 13 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.1% 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.3% 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 70.5%

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

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

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

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

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

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

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

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

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

Alternative 2: 89.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t1 \leq -4.5 \cdot 10^{-89}:\\
\;\;\;\;t\_1\\

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

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

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


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

    1. Initial program 55.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.24999999999999994e123 < t1 < -4.4999999999999999e-89 or 4.50000000000000023e-162 < t1 < 3.80000000000000006e132

    1. Initial program 83.9%

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

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

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

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

    if -4.4999999999999999e-89 < t1 < 4.50000000000000023e-162

    1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.80000000000000006e132 < t1

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.7% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -1.32e-48

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.32e-48 < t1 < 1.3e-129

    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-frac95.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3e-129 < t1

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.7% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -5.8e-49

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{v}{\color{blue}{u - t1}} \]
    11. Simplified83.3%

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

    if -5.8e-49 < t1 < 1.75e-128

    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-frac95.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.75e-128 < t1

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -5.8 \cdot 10^{-49}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq 1.75 \cdot 10^{-128}:\\ \;\;\;\;\frac{v}{u} \cdot \frac{t1}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 79.4% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -1.29999999999999994e-48

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{v}{\color{blue}{u - t1}} \]
    11. Simplified83.3%

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

    if -1.29999999999999994e-48 < t1 < 2.4999999999999998e-130

    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-frac95.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4999999999999998e-130 < t1

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 77.1% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -8.19999999999999971e-50

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{v}{\color{blue}{u - t1}} \]
    11. Simplified83.3%

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

    if -8.19999999999999971e-50 < t1 < 6.2000000000000001e-129

    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-frac95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.2000000000000001e-129 < t1

    1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 67.7% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -5.1000000000000002e194 or 9.99999999999999948e123 < u

    1. Initial program 78.3%

      \[\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}} \]
      2. distribute-frac-neg99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto t1 \cdot \frac{v}{-u \cdot \color{blue}{u}} \]
    12. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

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

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

        \[\leadsto t1 \cdot \frac{v}{\color{blue}{\sqrt{u \cdot u} \cdot \sqrt{u \cdot u}}} \]
      5. add-sqr-sqrt77.1%

        \[\leadsto t1 \cdot \frac{v}{\color{blue}{u \cdot u}} \]
    13. Applied egg-rr77.1%

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

    if -5.1000000000000002e194 < u < 9.99999999999999948e123

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 58.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.3 \cdot 10^{+210} \lor \neg \left(u \leq 1.9 \cdot 10^{+127}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.29999999999999995e210 or 1.8999999999999999e127 < u

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.29999999999999995e210 < u < 1.8999999999999999e127

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

Alternative 9: 58.9% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 79.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt0.0%

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

        \[\leadsto -1 \cdot \frac{v}{t1 + \color{blue}{\sqrt{u \cdot u}}} \]
      3. sqr-neg80.4%

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

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

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

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

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

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

    if -3.1000000000000001e209 < u < 3.6999999999999998e127

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

    if 3.6999999999999998e127 < u

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 22.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.1 \cdot 10^{+54} \lor \neg \left(t1 \leq 3.2 \cdot 10^{+79}\right):\\
\;\;\;\;\frac{v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -3.0999999999999999e54 or 3.20000000000000003e79 < t1

    1. Initial program 56.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.0999999999999999e54 < t1 < 3.20000000000000003e79

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \frac{v}{t1 + \color{blue}{\sqrt{u \cdot u}}} \]
      3. sqr-neg53.4%

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

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

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

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

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

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

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

Alternative 11: 62.4% 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 70.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 62.3% accurate, 2.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{v}{\color{blue}{u - t1}} \]
  11. Simplified63.7%

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

Alternative 13: 14.0% 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 70.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{v}}{t1} \]
  11. Simplified17.4%

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

Reproduce

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