Rosa's DopplerBench

Percentage Accurate: 73.0% → 98.3%
Time: 13.0s
Alternatives: 14
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 73.0% accurate, 1.0× speedup?

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

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

Alternative 1: 98.3% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 79.0% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if u < -8.4999999999999998e73

    1. Initial program 78.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\frac{v}{1 + \frac{u}{t1}}}{u}} \]
    9. Step-by-step derivation
      1. distribute-neg-frac83.0%

        \[\leadsto \color{blue}{\frac{-\frac{v}{1 + \frac{u}{t1}}}{u}} \]
      2. distribute-neg-frac83.0%

        \[\leadsto \frac{\color{blue}{\frac{-v}{1 + \frac{u}{t1}}}}{u} \]
    10. Simplified83.0%

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

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

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

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

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

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

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

    if -8.4999999999999998e73 < u < -3.59999999999999996e31

    1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.59999999999999996e31 < u < -2.3000000000000001e-32

    1. Initial program 82.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3000000000000001e-32 < u < 4.79999999999999983e-55

    1. Initial program 68.7%

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

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

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

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

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

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

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

    if 4.79999999999999983e-55 < u

    1. Initial program 74.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -8.5 \cdot 10^{+73}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \mathbf{elif}\;u \leq -3.6 \cdot 10^{+31}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;u \leq -2.3 \cdot 10^{-32}:\\ \;\;\;\;\frac{t1}{\left(t1 - u\right) \cdot \frac{u}{v}}\\ \mathbf{elif}\;u \leq 4.8 \cdot 10^{-55}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{-t1}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.0% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if u < -1.24999999999999991e74

    1. Initial program 78.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\frac{v}{1 + \frac{u}{t1}}}{u}} \]
    9. Step-by-step derivation
      1. distribute-neg-frac83.0%

        \[\leadsto \color{blue}{\frac{-\frac{v}{1 + \frac{u}{t1}}}{u}} \]
      2. distribute-neg-frac83.0%

        \[\leadsto \frac{\color{blue}{\frac{-v}{1 + \frac{u}{t1}}}}{u} \]
    10. Simplified83.0%

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

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

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

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

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

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

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

    if -1.24999999999999991e74 < u < -3.5e31

    1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5e31 < u < -1.15000000000000005e-41

    1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.15000000000000005e-41 < u < 4.79999999999999983e-55

    1. Initial program 68.7%

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

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

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

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

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

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

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

    if 4.79999999999999983e-55 < u

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

Alternative 4: 78.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.38 \cdot 10^{+66} \lor \neg \left(t1 \leq -1.55 \cdot 10^{+27} \lor \neg \left(t1 \leq -3.2 \cdot 10^{-40}\right) \land t1 \leq 116000000000\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.38e66 or -1.54999999999999998e27 < t1 < -3.20000000000000002e-40 or 1.16e11 < t1

    1. Initial program 65.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.38e66 < t1 < -1.54999999999999998e27 or -3.20000000000000002e-40 < t1 < 1.16e11

    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. times-frac97.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.38 \cdot 10^{+66} \lor \neg \left(t1 \leq -1.55 \cdot 10^{+27} \lor \neg \left(t1 \leq -3.2 \cdot 10^{-40}\right) \land t1 \leq 116000000000\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u} \cdot \frac{t1}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 78.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{-v}{u}\\
t_2 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -1.38 \cdot 10^{+66}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t1 \leq -1.1 \cdot 10^{+26}:\\
\;\;\;\;t\_1 \cdot \frac{t1}{u}\\

\mathbf{elif}\;t1 \leq -2.95 \cdot 10^{-40} \lor \neg \left(t1 \leq 3500000000000\right):\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -1.38e66 or -1.10000000000000004e26 < t1 < -2.94999999999999983e-40 or 3.5e12 < t1

    1. Initial program 65.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.38e66 < t1 < -1.10000000000000004e26

    1. Initial program 60.2%

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

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

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

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

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

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

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

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

    if -2.94999999999999983e-40 < t1 < 3.5e12

    1. Initial program 82.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\frac{v}{1 + \frac{u}{t1}}}{u}} \]
    9. Step-by-step derivation
      1. distribute-neg-frac76.0%

        \[\leadsto \color{blue}{\frac{-\frac{v}{1 + \frac{u}{t1}}}{u}} \]
      2. distribute-neg-frac76.0%

        \[\leadsto \frac{\color{blue}{\frac{-v}{1 + \frac{u}{t1}}}}{u} \]
    10. Simplified76.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.38 \cdot 10^{+66}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq -1.1 \cdot 10^{+26}:\\ \;\;\;\;\frac{-v}{u} \cdot \frac{t1}{u}\\ \mathbf{elif}\;t1 \leq -2.95 \cdot 10^{-40} \lor \neg \left(t1 \leq 3500000000000\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1 \cdot \frac{-v}{u}}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 95.7% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 77.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\frac{v}{1 + \frac{u}{t1}}}{u}} \]
    9. Step-by-step derivation
      1. distribute-neg-frac86.0%

        \[\leadsto \color{blue}{\frac{-\frac{v}{1 + \frac{u}{t1}}}{u}} \]
      2. distribute-neg-frac86.0%

        \[\leadsto \frac{\color{blue}{\frac{-v}{1 + \frac{u}{t1}}}}{u} \]
    10. Simplified86.0%

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

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

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

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

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

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

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

    if -1.14999999999999992e104 < u < 1.2499999999999999e161

    1. Initial program 74.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2499999999999999e161 < u

    1. Initial program 59.6%

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

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

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

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

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

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

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

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

Alternative 7: 68.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -7.2 \cdot 10^{+88} \lor \neg \left(u \leq 3.8 \cdot 10^{+63}\right):\\
\;\;\;\;\frac{v}{u} \cdot \frac{t1}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -7.2000000000000004e88 or 3.8000000000000001e63 < u

    1. Initial program 73.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\frac{v}{1 + \frac{u}{t1}}}{u}} \]
    9. Step-by-step derivation
      1. distribute-neg-frac83.5%

        \[\leadsto \color{blue}{\frac{-\frac{v}{1 + \frac{u}{t1}}}{u}} \]
      2. distribute-neg-frac83.5%

        \[\leadsto \frac{\color{blue}{\frac{-v}{1 + \frac{u}{t1}}}}{u} \]
    10. Simplified83.5%

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

      \[\leadsto \frac{\frac{-v}{\color{blue}{\frac{u}{t1}}}}{u} \]
    12. Step-by-step derivation
      1. div-inv81.8%

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

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

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

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

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

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

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

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

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

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

    if -7.2000000000000004e88 < u < 3.8000000000000001e63

    1. Initial program 73.1%

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

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

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

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

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

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

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

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

Alternative 8: 22.9% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -3.1999999999999999e148 or 1.99999999999999996e150 < t1

    1. Initial program 43.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1999999999999999e148 < t1 < 1.99999999999999996e150

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 98.1% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 56.3% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.99999999999999984e217

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999984e217 < u

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

Alternative 11: 56.3% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -5.20000000000000023e217

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{v}}{\frac{u}{-t1}}}{t1 + u} \]
      5. add-sqr-sqrt59.8%

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

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

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

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

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

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

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

    if -5.20000000000000023e217 < u

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

Alternative 12: 56.3% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -4.1000000000000002e217

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    10. Simplified43.1%

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

    if -4.1000000000000002e217 < u

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

Alternative 13: 61.7% 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 73.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{0 - \frac{v}{\frac{t1 - u}{t1}}}}{t1 + u} \]
    10. div-sub71.4%

      \[\leadsto \frac{0 - \frac{v}{\color{blue}{\frac{t1}{t1} - \frac{u}{t1}}}}{t1 + u} \]
    11. *-inverses71.4%

      \[\leadsto \frac{0 - \frac{v}{\color{blue}{1} - \frac{u}{t1}}}{t1 + u} \]
    12. sub-neg71.4%

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

      \[\leadsto \frac{0 - \frac{v}{1 + \color{blue}{\frac{-u}{t1}}}}{t1 + u} \]
    14. add-sqr-sqrt38.7%

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{0 - \frac{v}{1 + \frac{u}{t1}}}}{t1 + u} \]
  9. Step-by-step derivation
    1. neg-sub098.1%

      \[\leadsto \frac{\color{blue}{-\frac{v}{1 + \frac{u}{t1}}}}{t1 + u} \]
    2. distribute-neg-frac98.1%

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

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

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

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

    \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  14. Final simplification56.8%

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

Alternative 14: 14.2% accurate, 4.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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