Rosa's DopplerBench

Percentage Accurate: 72.5% → 97.9%
Time: 13.9s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 72.5% accurate, 1.0× speedup?

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

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Alternative 1: 97.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t1 \leq -1 \cdot 10^{-203}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t1 \leq 5.5 \cdot 10^{+155}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 34.5%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    6. Simplified87.3%

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

    if -1.35000000000000003e154 < t1 < -1e-203 or 1.6999999999999999e-264 < t1 < 5.5000000000000001e155

    1. Initial program 84.2%

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

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

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

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

    if -1e-203 < t1 < 1.6999999999999999e-264

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{v}{\color{blue}{\frac{u}{\frac{-t1}{u}}}} \]
      4. add-sqr-sqrt57.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{v}{-\frac{u}{\color{blue}{\frac{-t1}{u}}}} \]
      4. add-sqr-sqrt34.6%

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

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

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

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

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

        \[\leadsto \frac{v}{-\color{blue}{\frac{u}{t1} \cdot u}} \]
      10. distribute-rgt-neg-in93.9%

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

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

    if 5.5000000000000001e155 < t1

    1. Initial program 51.5%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;t1 \leq -1 \cdot 10^{-203}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;t1 \leq 1.7 \cdot 10^{-264}:\\ \;\;\;\;\frac{v}{u \cdot \frac{-u}{t1}}\\ \mathbf{elif}\;t1 \leq 5.5 \cdot 10^{+155}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{u}{\frac{t1}{v}} - v}{t1 + u}\\ \end{array} \]

Alternative 3: 77.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1}\\ \mathbf{if}\;u \leq -5.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{\frac{-t1}{\frac{u}{v}}}{t1 + u}\\ \mathbf{elif}\;u \leq 1.95 \cdot 10^{-51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;u \leq 5.1 \cdot 10^{-23}:\\ \;\;\;\;\frac{v \cdot \frac{-t1}{u}}{t1 + u}\\ \mathbf{elif}\;u \leq 3.5 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) t1)))
   (if (<= u -5.5e-40)
     (/ (/ (- t1) (/ u v)) (+ t1 u))
     (if (<= u 1.95e-51)
       t_1
       (if (<= u 5.1e-23)
         (/ (* v (/ (- t1) u)) (+ t1 u))
         (if (<= u 3.5e+68) t_1 (/ (* t1 (/ v u)) (- t1 u))))))))
double code(double u, double v, double t1) {
	double t_1 = -v / t1;
	double tmp;
	if (u <= -5.5e-40) {
		tmp = (-t1 / (u / v)) / (t1 + u);
	} else if (u <= 1.95e-51) {
		tmp = t_1;
	} else if (u <= 5.1e-23) {
		tmp = (v * (-t1 / u)) / (t1 + u);
	} else if (u <= 3.5e+68) {
		tmp = t_1;
	} else {
		tmp = (t1 * (v / u)) / (t1 - u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -v / t1
    if (u <= (-5.5d-40)) then
        tmp = (-t1 / (u / v)) / (t1 + u)
    else if (u <= 1.95d-51) then
        tmp = t_1
    else if (u <= 5.1d-23) then
        tmp = (v * (-t1 / u)) / (t1 + u)
    else if (u <= 3.5d+68) then
        tmp = t_1
    else
        tmp = (t1 * (v / u)) / (t1 - u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -v / t1;
	double tmp;
	if (u <= -5.5e-40) {
		tmp = (-t1 / (u / v)) / (t1 + u);
	} else if (u <= 1.95e-51) {
		tmp = t_1;
	} else if (u <= 5.1e-23) {
		tmp = (v * (-t1 / u)) / (t1 + u);
	} else if (u <= 3.5e+68) {
		tmp = t_1;
	} else {
		tmp = (t1 * (v / u)) / (t1 - u);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / t1
	tmp = 0
	if u <= -5.5e-40:
		tmp = (-t1 / (u / v)) / (t1 + u)
	elif u <= 1.95e-51:
		tmp = t_1
	elif u <= 5.1e-23:
		tmp = (v * (-t1 / u)) / (t1 + u)
	elif u <= 3.5e+68:
		tmp = t_1
	else:
		tmp = (t1 * (v / u)) / (t1 - u)
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / t1)
	tmp = 0.0
	if (u <= -5.5e-40)
		tmp = Float64(Float64(Float64(-t1) / Float64(u / v)) / Float64(t1 + u));
	elseif (u <= 1.95e-51)
		tmp = t_1;
	elseif (u <= 5.1e-23)
		tmp = Float64(Float64(v * Float64(Float64(-t1) / u)) / Float64(t1 + u));
	elseif (u <= 3.5e+68)
		tmp = t_1;
	else
		tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(t1 - u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / t1;
	tmp = 0.0;
	if (u <= -5.5e-40)
		tmp = (-t1 / (u / v)) / (t1 + u);
	elseif (u <= 1.95e-51)
		tmp = t_1;
	elseif (u <= 5.1e-23)
		tmp = (v * (-t1 / u)) / (t1 + u);
	elseif (u <= 3.5e+68)
		tmp = t_1;
	else
		tmp = (t1 * (v / u)) / (t1 - u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / t1), $MachinePrecision]}, If[LessEqual[u, -5.5e-40], N[(N[((-t1) / N[(u / v), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.95e-51], t$95$1, If[LessEqual[u, 5.1e-23], N[(N[(v * N[((-t1) / u), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 3.5e+68], t$95$1, N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;u \leq 1.95 \cdot 10^{-51}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;u \leq 3.5 \cdot 10^{+68}:\\
\;\;\;\;t_1\\

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


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

    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-/r*95.4%

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

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

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

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

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

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

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

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

    if -5.50000000000000002e-40 < u < 1.9499999999999999e-51 or 5.10000000000000011e-23 < u < 3.49999999999999977e68

    1. Initial program 62.2%

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

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

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

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

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

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

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

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

    if 1.9499999999999999e-51 < u < 5.10000000000000011e-23

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

    if 3.49999999999999977e68 < u

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -5.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{\frac{-t1}{\frac{u}{v}}}{t1 + u}\\ \mathbf{elif}\;u \leq 1.95 \cdot 10^{-51}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;u \leq 5.1 \cdot 10^{-23}:\\ \;\;\;\;\frac{v \cdot \frac{-t1}{u}}{t1 + u}\\ \mathbf{elif}\;u \leq 3.5 \cdot 10^{+68}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\ \end{array} \]

Alternative 4: 77.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-v}{t1}\\ \mathbf{if}\;u \leq -5.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{\frac{-t1}{\frac{u}{v}}}{t1 + u}\\ \mathbf{elif}\;u \leq 3 \cdot 10^{-51}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;u \leq 4.2 \cdot 10^{-24}:\\ \;\;\;\;v \cdot \frac{\frac{t1}{t1 + u}}{t1 - u}\\ \mathbf{elif}\;u \leq 4.2 \cdot 10^{+63}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ (- v) t1)))
   (if (<= u -5.5e-40)
     (/ (/ (- t1) (/ u v)) (+ t1 u))
     (if (<= u 3e-51)
       t_1
       (if (<= u 4.2e-24)
         (* v (/ (/ t1 (+ t1 u)) (- t1 u)))
         (if (<= u 4.2e+63) t_1 (/ (* t1 (/ v u)) (- t1 u))))))))
double code(double u, double v, double t1) {
	double t_1 = -v / t1;
	double tmp;
	if (u <= -5.5e-40) {
		tmp = (-t1 / (u / v)) / (t1 + u);
	} else if (u <= 3e-51) {
		tmp = t_1;
	} else if (u <= 4.2e-24) {
		tmp = v * ((t1 / (t1 + u)) / (t1 - u));
	} else if (u <= 4.2e+63) {
		tmp = t_1;
	} else {
		tmp = (t1 * (v / u)) / (t1 - u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: t_1
    real(8) :: tmp
    t_1 = -v / t1
    if (u <= (-5.5d-40)) then
        tmp = (-t1 / (u / v)) / (t1 + u)
    else if (u <= 3d-51) then
        tmp = t_1
    else if (u <= 4.2d-24) then
        tmp = v * ((t1 / (t1 + u)) / (t1 - u))
    else if (u <= 4.2d+63) then
        tmp = t_1
    else
        tmp = (t1 * (v / u)) / (t1 - u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -v / t1;
	double tmp;
	if (u <= -5.5e-40) {
		tmp = (-t1 / (u / v)) / (t1 + u);
	} else if (u <= 3e-51) {
		tmp = t_1;
	} else if (u <= 4.2e-24) {
		tmp = v * ((t1 / (t1 + u)) / (t1 - u));
	} else if (u <= 4.2e+63) {
		tmp = t_1;
	} else {
		tmp = (t1 * (v / u)) / (t1 - u);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -v / t1
	tmp = 0
	if u <= -5.5e-40:
		tmp = (-t1 / (u / v)) / (t1 + u)
	elif u <= 3e-51:
		tmp = t_1
	elif u <= 4.2e-24:
		tmp = v * ((t1 / (t1 + u)) / (t1 - u))
	elif u <= 4.2e+63:
		tmp = t_1
	else:
		tmp = (t1 * (v / u)) / (t1 - u)
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-v) / t1)
	tmp = 0.0
	if (u <= -5.5e-40)
		tmp = Float64(Float64(Float64(-t1) / Float64(u / v)) / Float64(t1 + u));
	elseif (u <= 3e-51)
		tmp = t_1;
	elseif (u <= 4.2e-24)
		tmp = Float64(v * Float64(Float64(t1 / Float64(t1 + u)) / Float64(t1 - u)));
	elseif (u <= 4.2e+63)
		tmp = t_1;
	else
		tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(t1 - u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -v / t1;
	tmp = 0.0;
	if (u <= -5.5e-40)
		tmp = (-t1 / (u / v)) / (t1 + u);
	elseif (u <= 3e-51)
		tmp = t_1;
	elseif (u <= 4.2e-24)
		tmp = v * ((t1 / (t1 + u)) / (t1 - u));
	elseif (u <= 4.2e+63)
		tmp = t_1;
	else
		tmp = (t1 * (v / u)) / (t1 - u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / t1), $MachinePrecision]}, If[LessEqual[u, -5.5e-40], N[(N[((-t1) / N[(u / v), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 3e-51], t$95$1, If[LessEqual[u, 4.2e-24], N[(v * N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 4.2e+63], t$95$1, N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;u \leq 3 \cdot 10^{-51}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;u \leq 4.2 \cdot 10^{+63}:\\
\;\;\;\;t_1\\

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


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

    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-/r*95.4%

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

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

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

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

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

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

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

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

    if -5.50000000000000002e-40 < u < 3.00000000000000002e-51 or 4.1999999999999999e-24 < u < 4.2000000000000004e63

    1. Initial program 62.2%

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

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

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

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

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

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

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

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

    if 3.00000000000000002e-51 < u < 4.1999999999999999e-24

    1. Initial program 89.5%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{-t1}{t1 + u} \cdot v}}{t1 + u} \]
      4. associate-/r/89.8%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{t1 + u}{v}}}}{t1 + u} \]
      5. div-inv89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000004e63 < u

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -5.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{\frac{-t1}{\frac{u}{v}}}{t1 + u}\\ \mathbf{elif}\;u \leq 3 \cdot 10^{-51}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{elif}\;u \leq 4.2 \cdot 10^{-24}:\\ \;\;\;\;v \cdot \frac{\frac{t1}{t1 + u}}{t1 - u}\\ \mathbf{elif}\;u \leq 4.2 \cdot 10^{+63}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\ \end{array} \]

Alternative 5: 76.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5 \cdot 10^{+47} \lor \neg \left(t1 \leq 3.55 \cdot 10^{-168} \lor \neg \left(t1 \leq 3.7 \cdot 10^{-47}\right) \land t1 \leq 1.4 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{-v}{t1 + u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -5.00000000000000022e47 or 3.55000000000000009e-168 < t1 < 3.7e-47 or 1.4000000000000001e24 < t1

    1. Initial program 61.5%

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

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

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

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

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

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

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

    if -5.00000000000000022e47 < t1 < 3.55000000000000009e-168 or 3.7e-47 < t1 < 1.4000000000000001e24

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -5 \cdot 10^{+47} \lor \neg \left(t1 \leq 3.55 \cdot 10^{-168} \lor \neg \left(t1 \leq 3.7 \cdot 10^{-47}\right) \land t1 \leq 1.4 \cdot 10^{+24}\right):\\ \;\;\;\;\frac{-v}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u} \cdot \frac{-t1}{u}\\ \end{array} \]

Alternative 6: 95.4% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

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

    if 1.69999999999999994e133 < u

    1. Initial program 74.8%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{u}{v}}}}{t1 + u} \]
    7. Step-by-step derivation
      1. frac-2neg94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq 1.7 \cdot 10^{+133}:\\ \;\;\;\;\left(-v\right) \cdot \frac{\frac{t1}{t1 + u}}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\ \end{array} \]

Alternative 7: 68.5% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.2500000000000001e105 or 8.4999999999999997e62 < u

    1. Initial program 80.5%

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

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

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

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

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

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

        \[\leadsto v \cdot \frac{\color{blue}{-t1}}{{u}^{2}} \]
      3. unpow275.5%

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

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

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

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

        \[\leadsto \frac{v}{\color{blue}{\frac{u}{\frac{-t1}{u}}}} \]
      4. add-sqr-sqrt39.9%

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

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

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

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

        \[\leadsto \frac{v}{\frac{u}{\frac{\color{blue}{t1}}{u}}} \]
    8. Applied egg-rr67.5%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{\frac{t1}{u}}}} \]
    9. Taylor expanded in v around 0 68.3%

      \[\leadsto \color{blue}{\frac{t1 \cdot v}{{u}^{2}}} \]
    10. Step-by-step derivation
      1. associate-/l*73.0%

        \[\leadsto \color{blue}{\frac{t1}{\frac{{u}^{2}}{v}}} \]
      2. unpow273.0%

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

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

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

    if -2.2500000000000001e105 < u < 8.4999999999999997e62

    1. Initial program 66.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.1%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    6. Simplified72.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.25 \cdot 10^{+105} \lor \neg \left(u \leq 8.5 \cdot 10^{+62}\right):\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 8: 57.7% accurate, 1.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.1e183 or 1.7999999999999998e110 < u

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{u}{v}}}}{t1 + u} \]
    7. Step-by-step derivation
      1. frac-2neg97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1e183 < u < 1.7999999999999998e110

    1. Initial program 68.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.0%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    6. Simplified67.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.1 \cdot 10^{+183}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{elif}\;u \leq 1.8 \cdot 10^{+110}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]

Alternative 9: 57.7% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{v}{u}} \]
      2. distribute-neg-frac41.9%

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

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

    if -3.2999999999999998e184 < u < 6.8000000000000003e110

    1. Initial program 68.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.0%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    6. Simplified67.5%

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

    if 6.8000000000000003e110 < u

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.3 \cdot 10^{+184}:\\ \;\;\;\;\frac{-v}{u}\\ \mathbf{elif}\;u \leq 6.8 \cdot 10^{+110}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]

Alternative 10: 23.1% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;t1 \leq 1.32 \cdot 10^{+98}:\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -4.29999999999999965e137 or 1.3200000000000001e98 < t1

    1. Initial program 48.0%

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

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

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

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

      \[\leadsto v \cdot \color{blue}{\frac{-1}{t1}} \]
    5. Step-by-step derivation
      1. expm1-log1p-u79.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(v \cdot \frac{-1}{t1}\right)\right)} \]
      2. expm1-udef52.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(v \cdot \frac{-1}{t1}\right)} - 1} \]
      3. frac-2neg52.3%

        \[\leadsto e^{\mathsf{log1p}\left(v \cdot \color{blue}{\frac{--1}{-t1}}\right)} - 1 \]
      4. metadata-eval52.3%

        \[\leadsto e^{\mathsf{log1p}\left(v \cdot \frac{\color{blue}{1}}{-t1}\right)} - 1 \]
      5. un-div-inv52.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{v}{-t1}}\right)} - 1 \]
      6. add-sqr-sqrt24.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{v}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}\right)} - 1 \]
      7. sqrt-unprod43.6%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{v}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}\right)} - 1 \]
      8. sqr-neg43.6%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{v}{\sqrt{\color{blue}{t1 \cdot t1}}}\right)} - 1 \]
      9. sqrt-unprod24.4%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{v}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}\right)} - 1 \]
      10. add-sqr-sqrt43.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{v}{\color{blue}{t1}}\right)} - 1 \]
    6. Applied egg-rr43.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v}{t1}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def40.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v}{t1}\right)\right)} \]
      2. expm1-log1p40.3%

        \[\leadsto \color{blue}{\frac{v}{t1}} \]
    8. Simplified40.3%

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

    if -4.29999999999999965e137 < t1 < 1.3200000000000001e98

    1. Initial program 83.2%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-t1}{\frac{u}{v}}}}{t1 + u} \]
    7. Step-by-step derivation
      1. frac-2neg66.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -4.3 \cdot 10^{+137}:\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{elif}\;t1 \leq 1.32 \cdot 10^{+98}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{t1}\\ \end{array} \]

Alternative 11: 60.9% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-*l/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. Taylor expanded in t1 around inf 53.4%

    \[\leadsto v \cdot \color{blue}{\frac{-1}{t1}} \]
  5. Step-by-step derivation
    1. expm1-log1p-u43.1%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(v \cdot \frac{-1}{t1}\right)\right)} \]
    2. expm1-udef31.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(v \cdot \frac{-1}{t1}\right)} - 1} \]
    3. frac-2neg31.3%

      \[\leadsto e^{\mathsf{log1p}\left(v \cdot \color{blue}{\frac{--1}{-t1}}\right)} - 1 \]
    4. metadata-eval31.3%

      \[\leadsto e^{\mathsf{log1p}\left(v \cdot \frac{\color{blue}{1}}{-t1}\right)} - 1 \]
    5. un-div-inv31.3%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{v}{-t1}}\right)} - 1 \]
    6. add-sqr-sqrt14.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{v}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}\right)} - 1 \]
    7. sqrt-unprod24.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{v}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}\right)} - 1 \]
    8. sqr-neg24.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{v}{\sqrt{\color{blue}{t1 \cdot t1}}}\right)} - 1 \]
    9. sqrt-unprod12.1%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{v}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}\right)} - 1 \]
    10. add-sqr-sqrt22.4%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{v}{\color{blue}{t1}}\right)} - 1 \]
  6. Applied egg-rr22.4%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v}{t1}\right)} - 1} \]
  7. Step-by-step derivation
    1. expm1-def14.7%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v}{t1}\right)\right)} \]
    2. expm1-log1p15.1%

      \[\leadsto \color{blue}{\frac{v}{t1}} \]
  8. Simplified15.1%

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  9. Final simplification15.1%

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

Reproduce

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