Rosa's DopplerBench

Percentage Accurate: 72.7% → 98.1%
Time: 16.7s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 72.7% accurate, 1.0× speedup?

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

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

Alternative 1: 98.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{t1}{\left(-t1\right) - 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(t1 / Float64(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}{\left(-t1\right) - u} \cdot \frac{v}{t1 + u}
\end{array}
Derivation
  1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

Alternative 2: 89.9% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t1 \leq 2.25 \cdot 10^{+139}:\\
\;\;\;\;t1 \cdot \frac{t\_1}{t1 + u}\\

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


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

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000028e69 < t1 < 2.25e139

    1. Initial program 82.4%

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

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

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

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

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

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

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

    if 2.25e139 < t1

    1. Initial program 50.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -3.8 \cdot 10^{+69}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u}\\ \mathbf{elif}\;t1 \leq 2.25 \cdot 10^{+139}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{\left(-t1\right) - u}}{t1 + u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{u - t1}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -20000:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u}\\

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

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


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

    1. Initial program 62.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e4 < t1 < 3.6e21

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6e21 < t1

    1. Initial program 57.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}} \]
      2. distribute-frac-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -56000000:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u}\\

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

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


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

    1. Initial program 62.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.6e7 < t1 < 6.5e21

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.5e21 < t1

    1. Initial program 57.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}} \]
      2. distribute-frac-neg99.8%

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

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

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

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

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

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

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

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

Alternative 5: 79.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -25000:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u}\\

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

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


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

    1. Initial program 62.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -25000 < t1 < 5.7999999999999996e-116

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.7999999999999996e-116 < t1

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
    6. Applied egg-rr99.9%

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

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

        \[\leadsto \frac{\frac{-t1 \cdot \frac{v}{t1 + u}}{\color{blue}{1}}}{t1 + u} \]
      3. /-rgt-identity99.9%

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

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

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

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

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

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

Alternative 6: 79.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -27000 \lor \neg \left(t1 \leq 1.45 \cdot 10^{-103}\right):\\
\;\;\;\;\frac{v}{\left(-t1\right) - u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -27000 or 1.4499999999999999e-103 < t1

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
    6. Applied egg-rr99.9%

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

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

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

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

    if -27000 < t1 < 1.4499999999999999e-103

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 78.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -150000 \lor \neg \left(t1 \leq 1.45 \cdot 10^{-103}\right):\\
\;\;\;\;\frac{v}{\left(-t1\right) - u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.5e5 or 1.4499999999999999e-103 < t1

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
    6. Applied egg-rr99.9%

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

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

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

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

    if -1.5e5 < t1 < 1.4499999999999999e-103

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 65.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.5 \cdot 10^{-141} \lor \neg \left(t1 \leq 2.2 \cdot 10^{-111}\right):\\
\;\;\;\;\frac{v}{\left(-t1\right) - u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -4.5e-141 or 2.2e-111 < t1

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
    6. Applied egg-rr99.9%

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

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

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

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

    if -4.5e-141 < t1 < 2.2e-111

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 65.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -9.2 \cdot 10^{-142} \lor \neg \left(t1 \leq 2.1 \cdot 10^{-112}\right):\\
\;\;\;\;\frac{v}{\left(-t1\right) - u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -9.20000000000000009e-142 or 2.1000000000000001e-112 < t1

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
    6. Applied egg-rr99.9%

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

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

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

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

    if -9.20000000000000009e-142 < t1 < 2.1000000000000001e-112

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 59.0% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.6e186 or 1.1e161 < u

    1. Initial program 81.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t1 around inf 58.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{v}}} \]
    12. Simplified58.4%

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

    if -1.6e186 < u < 1.1e161

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 58.7% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.40000000000000005e186 or 1.15e161 < u

    1. Initial program 81.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.40000000000000005e186 < u < 1.15e161

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 58.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.5 \cdot 10^{+187} \lor \neg \left(u \leq 1.15 \cdot 10^{+161}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.5e187 or 1.15e161 < u

    1. Initial program 81.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t1 around inf 58.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e187 < u < 1.15e161

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 22.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -350000000 \lor \neg \left(t1 \leq 9.2 \cdot 10^{+213}\right):\\
\;\;\;\;\frac{v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -3.5e8 or 9.19999999999999992e213 < t1

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

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

    if -3.5e8 < t1 < 9.19999999999999992e213

    1. Initial program 79.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t1 around inf 42.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 61.6% accurate, 1.7× speedup?

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

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

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in t1 around inf 47.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto v \cdot \frac{1}{\color{blue}{u - t1}} \]
  10. Step-by-step derivation
    1. un-div-inv60.6%

      \[\leadsto \color{blue}{\frac{v}{u - t1}} \]
    2. sub-neg60.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{-\frac{t1 + u}{v}}} \]
    11. metadata-eval27.2%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 61.7% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{v}{\left(-t1\right) - 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(v / Float64(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}{\left(-t1\right) - u}
\end{array}
Derivation
  1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{v}{\left(-t1\right) - u} \]
  11. Add Preprocessing

Alternative 16: 61.8% accurate, 2.4× speedup?

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

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

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in t1 around inf 47.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 14.4% 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.5%

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

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

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

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

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

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

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

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

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

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

Reproduce

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