Rosa's DopplerBench

Percentage Accurate: 73.1% → 98.1%
Time: 10.8s
Alternatives: 18
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 18 alternatives:

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

Initial Program: 73.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.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -9.2 \cdot 10^{+73} \lor \neg \left(t1 \leq 7.5 \cdot 10^{+117}\right):\\
\;\;\;\;\frac{v}{u \cdot \left(-2\right) - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -9.199999999999999e73 or 7.5e117 < t1

    1. Initial program 46.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.199999999999999e73 < t1 < 7.5e117

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.5% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 23.5%

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

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

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

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

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

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

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

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

    if -2.2000000000000001e158 < t1 < 4.10000000000000017e153

    1. Initial program 84.9%

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

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

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

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

    if 4.10000000000000017e153 < t1

    1. Initial program 39.2%

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

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

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

Alternative 4: 77.6% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 70.6%

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

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

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

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

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

    if -2.69999999999999999e-129 < t1 < 1.3500000000000001e-85

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

    if 1.3500000000000001e-85 < t1

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 80.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4 \cdot 10^{-42} \lor \neg \left(t1 \leq 1.1 \cdot 10^{-87}\right):\\
\;\;\;\;\frac{v}{u \cdot \left(-2\right) - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -4.00000000000000015e-42 or 1.09999999999999994e-87 < t1

    1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000015e-42 < t1 < 1.09999999999999994e-87

    1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 78.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.16 \cdot 10^{-122} \lor \neg \left(t1 \leq 1.35 \cdot 10^{-85}\right):\\
\;\;\;\;\frac{v}{u \cdot \left(-2\right) - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.16000000000000001e-122 or 1.3500000000000001e-85 < t1

    1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.16000000000000001e-122 < t1 < 1.3500000000000001e-85

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 78.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.16 \cdot 10^{-122} \lor \neg \left(t1 \leq 4.6 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{v}{\left(-u\right) - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.16000000000000001e-122 or 4.59999999999999992e-86 < t1

    1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.16000000000000001e-122 < t1 < 4.59999999999999992e-86

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 79.6% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 70.3%

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

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

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

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

    if -1.12e-122 < t1 < 1.05e-86

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{t1 \cdot \frac{v}{u}}}{t1 + u} \]
      3. distribute-rgt-neg-in82.1%

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

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

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

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

    if 1.05e-86 < t1

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 79.3% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

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

    if -2.85000000000000014e-123 < t1 < 1.3500000000000001e-85

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\color{blue}{t1 \cdot \frac{v}{u}}}{t1 + u} \]
      3. distribute-rgt-neg-in82.1%

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

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

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

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

    if 1.3500000000000001e-85 < t1

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 67.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.55 \cdot 10^{+147} \lor \neg \left(u \leq 2.8 \cdot 10^{+123}\right):\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.55e147 or 2.80000000000000011e123 < u

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt20.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-unprod40.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-neg40.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.2%

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

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

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

        \[\leadsto \frac{-\color{blue}{t1 \cdot \frac{v}{u}}}{t1 + u} \]
      3. distribute-rgt-neg-in94.4%

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

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

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

      \[\leadsto \frac{t1 \cdot \frac{v}{-u}}{\color{blue}{u}} \]
    11. Step-by-step derivation
      1. clear-num94.4%

        \[\leadsto \frac{t1 \cdot \color{blue}{\frac{1}{\frac{-u}{v}}}}{u} \]
      2. un-div-inv94.5%

        \[\leadsto \frac{\color{blue}{\frac{t1}{\frac{-u}{v}}}}{u} \]
      3. add-sqr-sqrt51.2%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{t1}{u} \cdot v}}{u} \]
    14. Simplified72.0%

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

    if -1.55e147 < u < 2.80000000000000011e123

    1. Initial program 70.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-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 69.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 58.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -7.2 \cdot 10^{+188} \lor \neg \left(u \leq 5.2 \cdot 10^{+118}\right):\\
\;\;\;\;\frac{1}{\frac{u}{v}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -7.20000000000000041e188 or 5.20000000000000032e118 < u

    1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{v}}} \]
      2. inv-pow45.5%

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

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

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

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

    if -7.20000000000000041e188 < u < 5.20000000000000032e118

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

Alternative 12: 58.5% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.7e186 or 1.00000000000000005e117 < u

    1. Initial program 81.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7e186 < u < 1.00000000000000005e117

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

Alternative 13: 58.5% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.3e186 < u < 2.3000000000000001e119

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

    if 2.3000000000000001e119 < 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-frac97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -4.3 \cdot 10^{+186}:\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \mathbf{elif}\;u \leq 2.3 \cdot 10^{+119}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 58.5% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 83.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.49999999999999997e187 < u < 4.50000000000000002e118

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

    if 4.50000000000000002e118 < 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-frac97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 61.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.1000000000000002e211 < u

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 19.5% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq 1.95 \cdot 10^{+192}:\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < 1.9499999999999999e192

    1. Initial program 75.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9499999999999999e192 < t1

    1. Initial program 51.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt44.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{v \cdot 1}{t1}} \]
      2. *-rgt-identity51.7%

        \[\leadsto \frac{\color{blue}{v}}{t1} \]
    11. Simplified51.7%

      \[\leadsto \color{blue}{\frac{v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 61.6% 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 73.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 13.8% 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 73.1%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  8. Step-by-step derivation
    1. add-sqr-sqrt26.3%

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

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

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

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

      \[\leadsto \frac{\color{blue}{v}}{t1} \]
    6. div-inv10.3%

      \[\leadsto \color{blue}{v \cdot \frac{1}{t1}} \]
  9. Applied egg-rr10.3%

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

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

      \[\leadsto \frac{\color{blue}{v}}{t1} \]
  11. Simplified10.3%

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

Reproduce

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