
(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:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (u v t1) :precision binary64 (/ (* (/ t1 (+ u t1)) v) (- (- t1) u)))
double code(double u, double v, double t1) {
return ((t1 / (u + t1)) * 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 / (u + t1)) * v) / (-t1 - u)
end function
public static double code(double u, double v, double t1) {
return ((t1 / (u + t1)) * v) / (-t1 - u);
}
def code(u, v, t1): return ((t1 / (u + t1)) * v) / (-t1 - u)
function code(u, v, t1) return Float64(Float64(Float64(t1 / Float64(u + t1)) * v) / Float64(Float64(-t1) - u)) end
function tmp = code(u, v, t1) tmp = ((t1 / (u + t1)) * v) / (-t1 - u); end
code[u_, v_, t1_] := N[(N[(N[(t1 / N[(u + t1), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t1}{u + t1} \cdot v}{\left(-t1\right) - u}
\end{array}
Initial program 73.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6498.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.8
Applied rewrites98.8%
Final simplification98.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* (- t1) v) (* (+ u t1) (+ u t1)))))
(if (<= u -5.5e+136)
(/ (/ t1 u) (/ (- u) v))
(if (<= u -8e-137)
t_1
(if (<= u 2.4e-136) (/ (* (fma (/ u t1) 2.0 -1.0) v) t1) t_1)))))
double code(double u, double v, double t1) {
double t_1 = (-t1 * v) / ((u + t1) * (u + t1));
double tmp;
if (u <= -5.5e+136) {
tmp = (t1 / u) / (-u / v);
} else if (u <= -8e-137) {
tmp = t_1;
} else if (u <= 2.4e-136) {
tmp = (fma((u / t1), 2.0, -1.0) * v) / t1;
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(Float64(-t1) * v) / Float64(Float64(u + t1) * Float64(u + t1))) tmp = 0.0 if (u <= -5.5e+136) tmp = Float64(Float64(t1 / u) / Float64(Float64(-u) / v)); elseif (u <= -8e-137) tmp = t_1; elseif (u <= 2.4e-136) tmp = Float64(Float64(fma(Float64(u / t1), 2.0, -1.0) * v) / t1); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[((-t1) * v), $MachinePrecision] / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -5.5e+136], N[(N[(t1 / u), $MachinePrecision] / N[((-u) / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, -8e-137], t$95$1, If[LessEqual[u, 2.4e-136], N[(N[(N[(N[(u / t1), $MachinePrecision] * 2.0 + -1.0), $MachinePrecision] * v), $MachinePrecision] / t1), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(-t1\right) \cdot v}{\left(u + t1\right) \cdot \left(u + t1\right)}\\
\mathbf{if}\;u \leq -5.5 \cdot 10^{+136}:\\
\;\;\;\;\frac{\frac{t1}{u}}{\frac{-u}{v}}\\
\mathbf{elif}\;u \leq -8 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 2.4 \cdot 10^{-136}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{u}{t1}, 2, -1\right) \cdot v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -5.50000000000000039e136Initial program 63.2%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6490.8
Applied rewrites90.8%
Applied rewrites91.0%
if -5.50000000000000039e136 < u < -7.99999999999999982e-137 or 2.3999999999999999e-136 < u Initial program 85.8%
if -7.99999999999999982e-137 < u < 2.3999999999999999e-136Initial program 54.3%
Taylor expanded in u around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6487.5
Applied rewrites87.5%
Taylor expanded in v around 0
Applied rewrites87.5%
Final simplification87.1%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* (- t1) v) (* (+ u t1) (+ u t1)))))
(if (<= u -5.5e+136)
(* (* (/ v u) t1) (/ -1.0 u))
(if (<= u -8e-137)
t_1
(if (<= u 2.4e-136) (/ (* (fma (/ u t1) 2.0 -1.0) v) t1) t_1)))))
double code(double u, double v, double t1) {
double t_1 = (-t1 * v) / ((u + t1) * (u + t1));
double tmp;
if (u <= -5.5e+136) {
tmp = ((v / u) * t1) * (-1.0 / u);
} else if (u <= -8e-137) {
tmp = t_1;
} else if (u <= 2.4e-136) {
tmp = (fma((u / t1), 2.0, -1.0) * v) / t1;
} else {
tmp = t_1;
}
return tmp;
}
function code(u, v, t1) t_1 = Float64(Float64(Float64(-t1) * v) / Float64(Float64(u + t1) * Float64(u + t1))) tmp = 0.0 if (u <= -5.5e+136) tmp = Float64(Float64(Float64(v / u) * t1) * Float64(-1.0 / u)); elseif (u <= -8e-137) tmp = t_1; elseif (u <= 2.4e-136) tmp = Float64(Float64(fma(Float64(u / t1), 2.0, -1.0) * v) / t1); else tmp = t_1; end return tmp end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[((-t1) * v), $MachinePrecision] / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -5.5e+136], N[(N[(N[(v / u), $MachinePrecision] * t1), $MachinePrecision] * N[(-1.0 / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, -8e-137], t$95$1, If[LessEqual[u, 2.4e-136], N[(N[(N[(N[(u / t1), $MachinePrecision] * 2.0 + -1.0), $MachinePrecision] * v), $MachinePrecision] / t1), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(-t1\right) \cdot v}{\left(u + t1\right) \cdot \left(u + t1\right)}\\
\mathbf{if}\;u \leq -5.5 \cdot 10^{+136}:\\
\;\;\;\;\left(\frac{v}{u} \cdot t1\right) \cdot \frac{-1}{u}\\
\mathbf{elif}\;u \leq -8 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 2.4 \cdot 10^{-136}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{u}{t1}, 2, -1\right) \cdot v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -5.50000000000000039e136Initial program 63.2%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6490.8
Applied rewrites90.8%
Applied rewrites75.0%
Applied rewrites90.9%
if -5.50000000000000039e136 < u < -7.99999999999999982e-137 or 2.3999999999999999e-136 < u Initial program 85.8%
if -7.99999999999999982e-137 < u < 2.3999999999999999e-136Initial program 54.3%
Taylor expanded in u around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6487.5
Applied rewrites87.5%
Taylor expanded in v around 0
Applied rewrites87.5%
Final simplification87.1%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* (- t1) v) (* (+ u t1) (+ u t1)))))
(if (<= u -5.5e+136)
(* (* (/ v u) t1) (/ -1.0 u))
(if (<= u -8e-137) t_1 (if (<= u 7.5e-134) (/ (- v) t1) t_1)))))
double code(double u, double v, double t1) {
double t_1 = (-t1 * v) / ((u + t1) * (u + t1));
double tmp;
if (u <= -5.5e+136) {
tmp = ((v / u) * t1) * (-1.0 / u);
} else if (u <= -8e-137) {
tmp = t_1;
} else if (u <= 7.5e-134) {
tmp = -v / t1;
} else {
tmp = t_1;
}
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 = (-t1 * v) / ((u + t1) * (u + t1))
if (u <= (-5.5d+136)) then
tmp = ((v / u) * t1) * ((-1.0d0) / u)
else if (u <= (-8d-137)) then
tmp = t_1
else if (u <= 7.5d-134) then
tmp = -v / t1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (-t1 * v) / ((u + t1) * (u + t1));
double tmp;
if (u <= -5.5e+136) {
tmp = ((v / u) * t1) * (-1.0 / u);
} else if (u <= -8e-137) {
tmp = t_1;
} else if (u <= 7.5e-134) {
tmp = -v / t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (-t1 * v) / ((u + t1) * (u + t1)) tmp = 0 if u <= -5.5e+136: tmp = ((v / u) * t1) * (-1.0 / u) elif u <= -8e-137: tmp = t_1 elif u <= 7.5e-134: tmp = -v / t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(Float64(-t1) * v) / Float64(Float64(u + t1) * Float64(u + t1))) tmp = 0.0 if (u <= -5.5e+136) tmp = Float64(Float64(Float64(v / u) * t1) * Float64(-1.0 / u)); elseif (u <= -8e-137) tmp = t_1; elseif (u <= 7.5e-134) tmp = Float64(Float64(-v) / t1); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (-t1 * v) / ((u + t1) * (u + t1)); tmp = 0.0; if (u <= -5.5e+136) tmp = ((v / u) * t1) * (-1.0 / u); elseif (u <= -8e-137) tmp = t_1; elseif (u <= 7.5e-134) tmp = -v / t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[((-t1) * v), $MachinePrecision] / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -5.5e+136], N[(N[(N[(v / u), $MachinePrecision] * t1), $MachinePrecision] * N[(-1.0 / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, -8e-137], t$95$1, If[LessEqual[u, 7.5e-134], N[((-v) / t1), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(-t1\right) \cdot v}{\left(u + t1\right) \cdot \left(u + t1\right)}\\
\mathbf{if}\;u \leq -5.5 \cdot 10^{+136}:\\
\;\;\;\;\left(\frac{v}{u} \cdot t1\right) \cdot \frac{-1}{u}\\
\mathbf{elif}\;u \leq -8 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 7.5 \cdot 10^{-134}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -5.50000000000000039e136Initial program 63.2%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6490.8
Applied rewrites90.8%
Applied rewrites75.0%
Applied rewrites90.9%
if -5.50000000000000039e136 < u < -7.99999999999999982e-137 or 7.50000000000000048e-134 < u Initial program 85.8%
if -7.99999999999999982e-137 < u < 7.50000000000000048e-134Initial program 54.3%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6486.7
Applied rewrites86.7%
Final simplification86.9%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (* (- t1) v) (* (+ u t1) (+ u t1)))))
(if (<= u -5.5e+136)
(/ (* (/ v u) t1) (- u))
(if (<= u -8e-137) t_1 (if (<= u 7.5e-134) (/ (- v) t1) t_1)))))
double code(double u, double v, double t1) {
double t_1 = (-t1 * v) / ((u + t1) * (u + t1));
double tmp;
if (u <= -5.5e+136) {
tmp = ((v / u) * t1) / -u;
} else if (u <= -8e-137) {
tmp = t_1;
} else if (u <= 7.5e-134) {
tmp = -v / t1;
} else {
tmp = t_1;
}
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 = (-t1 * v) / ((u + t1) * (u + t1))
if (u <= (-5.5d+136)) then
tmp = ((v / u) * t1) / -u
else if (u <= (-8d-137)) then
tmp = t_1
else if (u <= 7.5d-134) then
tmp = -v / t1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = (-t1 * v) / ((u + t1) * (u + t1));
double tmp;
if (u <= -5.5e+136) {
tmp = ((v / u) * t1) / -u;
} else if (u <= -8e-137) {
tmp = t_1;
} else if (u <= 7.5e-134) {
tmp = -v / t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = (-t1 * v) / ((u + t1) * (u + t1)) tmp = 0 if u <= -5.5e+136: tmp = ((v / u) * t1) / -u elif u <= -8e-137: tmp = t_1 elif u <= 7.5e-134: tmp = -v / t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(Float64(-t1) * v) / Float64(Float64(u + t1) * Float64(u + t1))) tmp = 0.0 if (u <= -5.5e+136) tmp = Float64(Float64(Float64(v / u) * t1) / Float64(-u)); elseif (u <= -8e-137) tmp = t_1; elseif (u <= 7.5e-134) tmp = Float64(Float64(-v) / t1); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = (-t1 * v) / ((u + t1) * (u + t1)); tmp = 0.0; if (u <= -5.5e+136) tmp = ((v / u) * t1) / -u; elseif (u <= -8e-137) tmp = t_1; elseif (u <= 7.5e-134) tmp = -v / t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[(N[((-t1) * v), $MachinePrecision] / N[(N[(u + t1), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -5.5e+136], N[(N[(N[(v / u), $MachinePrecision] * t1), $MachinePrecision] / (-u)), $MachinePrecision], If[LessEqual[u, -8e-137], t$95$1, If[LessEqual[u, 7.5e-134], N[((-v) / t1), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(-t1\right) \cdot v}{\left(u + t1\right) \cdot \left(u + t1\right)}\\
\mathbf{if}\;u \leq -5.5 \cdot 10^{+136}:\\
\;\;\;\;\frac{\frac{v}{u} \cdot t1}{-u}\\
\mathbf{elif}\;u \leq -8 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;u \leq 7.5 \cdot 10^{-134}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if u < -5.50000000000000039e136Initial program 63.2%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6490.8
Applied rewrites90.8%
Applied rewrites75.0%
Applied rewrites90.8%
if -5.50000000000000039e136 < u < -7.99999999999999982e-137 or 7.50000000000000048e-134 < u Initial program 85.8%
if -7.99999999999999982e-137 < u < 7.50000000000000048e-134Initial program 54.3%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6486.7
Applied rewrites86.7%
Final simplification86.9%
(FPCore (u v t1)
:precision binary64
(if (<= t1 -2.1e+167)
(/ (- v) (+ u t1))
(if (<= t1 2.6e+107)
(/ (- t1) (* (/ (+ u t1) v) (+ u t1)))
(/ (fma (* (/ v t1) u) 2.0 (- v)) t1))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -2.1e+167) {
tmp = -v / (u + t1);
} else if (t1 <= 2.6e+107) {
tmp = -t1 / (((u + t1) / v) * (u + t1));
} else {
tmp = fma(((v / t1) * u), 2.0, -v) / t1;
}
return tmp;
}
function code(u, v, t1) tmp = 0.0 if (t1 <= -2.1e+167) tmp = Float64(Float64(-v) / Float64(u + t1)); elseif (t1 <= 2.6e+107) tmp = Float64(Float64(-t1) / Float64(Float64(Float64(u + t1) / v) * Float64(u + t1))); else tmp = Float64(fma(Float64(Float64(v / t1) * u), 2.0, Float64(-v)) / t1); end return tmp end
code[u_, v_, t1_] := If[LessEqual[t1, -2.1e+167], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 2.6e+107], N[((-t1) / N[(N[(N[(u + t1), $MachinePrecision] / v), $MachinePrecision] * N[(u + t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(v / t1), $MachinePrecision] * u), $MachinePrecision] * 2.0 + (-v)), $MachinePrecision] / t1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.1 \cdot 10^{+167}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\mathbf{elif}\;t1 \leq 2.6 \cdot 10^{+107}:\\
\;\;\;\;\frac{-t1}{\frac{u + t1}{v} \cdot \left(u + t1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{v}{t1} \cdot u, 2, -v\right)}{t1}\\
\end{array}
\end{array}
if t1 < -2.0999999999999999e167Initial program 41.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6487.5
Applied rewrites87.5%
if -2.0999999999999999e167 < t1 < 2.6000000000000001e107Initial program 82.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
frac-2negN/A
frac-timesN/A
metadata-evalN/A
lift-neg.f64N/A
remove-double-negN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
remove-double-negN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6488.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.3
Applied rewrites88.3%
if 2.6000000000000001e107 < t1 Initial program 55.9%
Taylor expanded in u around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
unpow2N/A
associate-/r*N/A
associate-*r/N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6488.6
Applied rewrites88.6%
Final simplification88.3%
(FPCore (u v t1) :precision binary64 (if (<= u -0.165) (/ (* (/ v u) t1) (- u)) (if (<= u 4.5e-13) (/ (- v) t1) (/ (- t1) (* (/ u v) u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -0.165) {
tmp = ((v / u) * t1) / -u;
} else if (u <= 4.5e-13) {
tmp = -v / t1;
} 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 (u <= (-0.165d0)) then
tmp = ((v / u) * t1) / -u
else if (u <= 4.5d-13) then
tmp = -v / t1
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 (u <= -0.165) {
tmp = ((v / u) * t1) / -u;
} else if (u <= 4.5e-13) {
tmp = -v / t1;
} else {
tmp = -t1 / ((u / v) * u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -0.165: tmp = ((v / u) * t1) / -u elif u <= 4.5e-13: tmp = -v / t1 else: tmp = -t1 / ((u / v) * u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -0.165) tmp = Float64(Float64(Float64(v / u) * t1) / Float64(-u)); elseif (u <= 4.5e-13) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(-t1) / Float64(Float64(u / v) * u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -0.165) tmp = ((v / u) * t1) / -u; elseif (u <= 4.5e-13) tmp = -v / t1; else tmp = -t1 / ((u / v) * u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -0.165], N[(N[(N[(v / u), $MachinePrecision] * t1), $MachinePrecision] / (-u)), $MachinePrecision], If[LessEqual[u, 4.5e-13], N[((-v) / t1), $MachinePrecision], N[((-t1) / N[(N[(u / v), $MachinePrecision] * u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -0.165:\\
\;\;\;\;\frac{\frac{v}{u} \cdot t1}{-u}\\
\mathbf{elif}\;u \leq 4.5 \cdot 10^{-13}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{\frac{u}{v} \cdot u}\\
\end{array}
\end{array}
if u < -0.165000000000000008Initial program 74.5%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6480.3
Applied rewrites80.3%
Applied rewrites75.2%
Applied rewrites81.8%
if -0.165000000000000008 < u < 4.5e-13Initial program 65.5%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6474.5
Applied rewrites74.5%
if 4.5e-13 < u Initial program 84.2%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6479.3
Applied rewrites79.3%
Applied rewrites83.6%
(FPCore (u v t1) :precision binary64 (if (<= u -0.165) (* (/ (- v) u) (/ t1 u)) (if (<= u 4.5e-13) (/ (- v) t1) (/ (- t1) (* (/ u v) u)))))
double code(double u, double v, double t1) {
double tmp;
if (u <= -0.165) {
tmp = (-v / u) * (t1 / u);
} else if (u <= 4.5e-13) {
tmp = -v / t1;
} 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 (u <= (-0.165d0)) then
tmp = (-v / u) * (t1 / u)
else if (u <= 4.5d-13) then
tmp = -v / t1
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 (u <= -0.165) {
tmp = (-v / u) * (t1 / u);
} else if (u <= 4.5e-13) {
tmp = -v / t1;
} else {
tmp = -t1 / ((u / v) * u);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if u <= -0.165: tmp = (-v / u) * (t1 / u) elif u <= 4.5e-13: tmp = -v / t1 else: tmp = -t1 / ((u / v) * u) return tmp
function code(u, v, t1) tmp = 0.0 if (u <= -0.165) tmp = Float64(Float64(Float64(-v) / u) * Float64(t1 / u)); elseif (u <= 4.5e-13) tmp = Float64(Float64(-v) / t1); else tmp = Float64(Float64(-t1) / Float64(Float64(u / v) * u)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (u <= -0.165) tmp = (-v / u) * (t1 / u); elseif (u <= 4.5e-13) tmp = -v / t1; else tmp = -t1 / ((u / v) * u); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[u, -0.165], N[(N[((-v) / u), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 4.5e-13], N[((-v) / t1), $MachinePrecision], N[((-t1) / N[(N[(u / v), $MachinePrecision] * u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;u \leq -0.165:\\
\;\;\;\;\frac{-v}{u} \cdot \frac{t1}{u}\\
\mathbf{elif}\;u \leq 4.5 \cdot 10^{-13}:\\
\;\;\;\;\frac{-v}{t1}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t1}{\frac{u}{v} \cdot u}\\
\end{array}
\end{array}
if u < -0.165000000000000008Initial program 74.5%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6480.3
Applied rewrites80.3%
if -0.165000000000000008 < u < 4.5e-13Initial program 65.5%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6474.5
Applied rewrites74.5%
if 4.5e-13 < u Initial program 84.2%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6479.3
Applied rewrites79.3%
Applied rewrites83.6%
Final simplification78.7%
(FPCore (u v t1) :precision binary64 (if (<= t1 -4.6e-90) (/ 1.0 (/ (+ u t1) (- v))) (if (<= t1 1.9e-42) (* (/ (- v) u) (/ t1 u)) (/ (- v) (+ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -4.6e-90) {
tmp = 1.0 / ((u + t1) / -v);
} else if (t1 <= 1.9e-42) {
tmp = (-v / u) * (t1 / u);
} else {
tmp = -v / (u + t1);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (t1 <= (-4.6d-90)) then
tmp = 1.0d0 / ((u + t1) / -v)
else if (t1 <= 1.9d-42) then
tmp = (-v / u) * (t1 / u)
else
tmp = -v / (u + t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -4.6e-90) {
tmp = 1.0 / ((u + t1) / -v);
} else if (t1 <= 1.9e-42) {
tmp = (-v / u) * (t1 / u);
} else {
tmp = -v / (u + t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -4.6e-90: tmp = 1.0 / ((u + t1) / -v) elif t1 <= 1.9e-42: tmp = (-v / u) * (t1 / u) else: tmp = -v / (u + t1) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -4.6e-90) tmp = Float64(1.0 / Float64(Float64(u + t1) / Float64(-v))); elseif (t1 <= 1.9e-42) tmp = Float64(Float64(Float64(-v) / u) * Float64(t1 / u)); else tmp = Float64(Float64(-v) / Float64(u + t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -4.6e-90) tmp = 1.0 / ((u + t1) / -v); elseif (t1 <= 1.9e-42) tmp = (-v / u) * (t1 / u); else tmp = -v / (u + t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -4.6e-90], N[(1.0 / N[(N[(u + t1), $MachinePrecision] / (-v)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.9e-42], N[(N[((-v) / u), $MachinePrecision] * N[(t1 / u), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.6 \cdot 10^{-90}:\\
\;\;\;\;\frac{1}{\frac{u + t1}{-v}}\\
\mathbf{elif}\;t1 \leq 1.9 \cdot 10^{-42}:\\
\;\;\;\;\frac{-v}{u} \cdot \frac{t1}{u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\end{array}
\end{array}
if t1 < -4.5999999999999996e-90Initial program 70.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6474.9
Applied rewrites74.9%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
if -4.5999999999999996e-90 < t1 < 1.90000000000000009e-42Initial program 79.4%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6479.3
Applied rewrites79.3%
if 1.90000000000000009e-42 < t1 Initial program 68.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6480.6
Applied rewrites80.6%
Final simplification78.2%
(FPCore (u v t1) :precision binary64 (if (<= t1 -4.6e-90) (/ 1.0 (/ (+ u t1) (- v))) (if (<= t1 1.8e-42) (/ (* (- t1) v) (* u u)) (/ (- v) (+ u t1)))))
double code(double u, double v, double t1) {
double tmp;
if (t1 <= -4.6e-90) {
tmp = 1.0 / ((u + t1) / -v);
} else if (t1 <= 1.8e-42) {
tmp = (-t1 * v) / (u * u);
} else {
tmp = -v / (u + t1);
}
return tmp;
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
real(8) :: tmp
if (t1 <= (-4.6d-90)) then
tmp = 1.0d0 / ((u + t1) / -v)
else if (t1 <= 1.8d-42) then
tmp = (-t1 * v) / (u * u)
else
tmp = -v / (u + t1)
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double tmp;
if (t1 <= -4.6e-90) {
tmp = 1.0 / ((u + t1) / -v);
} else if (t1 <= 1.8e-42) {
tmp = (-t1 * v) / (u * u);
} else {
tmp = -v / (u + t1);
}
return tmp;
}
def code(u, v, t1): tmp = 0 if t1 <= -4.6e-90: tmp = 1.0 / ((u + t1) / -v) elif t1 <= 1.8e-42: tmp = (-t1 * v) / (u * u) else: tmp = -v / (u + t1) return tmp
function code(u, v, t1) tmp = 0.0 if (t1 <= -4.6e-90) tmp = Float64(1.0 / Float64(Float64(u + t1) / Float64(-v))); elseif (t1 <= 1.8e-42) tmp = Float64(Float64(Float64(-t1) * v) / Float64(u * u)); else tmp = Float64(Float64(-v) / Float64(u + t1)); end return tmp end
function tmp_2 = code(u, v, t1) tmp = 0.0; if (t1 <= -4.6e-90) tmp = 1.0 / ((u + t1) / -v); elseif (t1 <= 1.8e-42) tmp = (-t1 * v) / (u * u); else tmp = -v / (u + t1); end tmp_2 = tmp; end
code[u_, v_, t1_] := If[LessEqual[t1, -4.6e-90], N[(1.0 / N[(N[(u + t1), $MachinePrecision] / (-v)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.8e-42], N[(N[((-t1) * v), $MachinePrecision] / N[(u * u), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.6 \cdot 10^{-90}:\\
\;\;\;\;\frac{1}{\frac{u + t1}{-v}}\\
\mathbf{elif}\;t1 \leq 1.8 \cdot 10^{-42}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;\frac{-v}{u + t1}\\
\end{array}
\end{array}
if t1 < -4.5999999999999996e-90Initial program 70.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6474.9
Applied rewrites74.9%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
if -4.5999999999999996e-90 < t1 < 1.8000000000000001e-42Initial program 79.4%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6474.8
Applied rewrites74.8%
if 1.8000000000000001e-42 < t1 Initial program 68.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6480.6
Applied rewrites80.6%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -4.6e-90)
t_1
(if (<= t1 1.8e-42) (/ (* (- t1) v) (* u u)) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -4.6e-90) {
tmp = t_1;
} else if (t1 <= 1.8e-42) {
tmp = (-t1 * v) / (u * u);
} else {
tmp = t_1;
}
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 / (u + t1)
if (t1 <= (-4.6d-90)) then
tmp = t_1
else if (t1 <= 1.8d-42) then
tmp = (-t1 * v) / (u * u)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -4.6e-90) {
tmp = t_1;
} else if (t1 <= 1.8e-42) {
tmp = (-t1 * v) / (u * u);
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -4.6e-90: tmp = t_1 elif t1 <= 1.8e-42: tmp = (-t1 * v) / (u * u) else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -4.6e-90) tmp = t_1; elseif (t1 <= 1.8e-42) tmp = Float64(Float64(Float64(-t1) * v) / Float64(u * u)); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (u + t1); tmp = 0.0; if (t1 <= -4.6e-90) tmp = t_1; elseif (t1 <= 1.8e-42) tmp = (-t1 * v) / (u * u); else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -4.6e-90], t$95$1, If[LessEqual[t1, 1.8e-42], N[(N[((-t1) * v), $MachinePrecision] / N[(u * u), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -4.6 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.8 \cdot 10^{-42}:\\
\;\;\;\;\frac{\left(-t1\right) \cdot v}{u \cdot u}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -4.5999999999999996e-90 or 1.8000000000000001e-42 < t1 Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6477.5
Applied rewrites77.5%
if -4.5999999999999996e-90 < t1 < 1.8000000000000001e-42Initial program 79.4%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6474.8
Applied rewrites74.8%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -4.6e-90)
t_1
(if (<= t1 1.8e-42) (* (/ (- t1) (* u u)) v) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -4.6e-90) {
tmp = t_1;
} else if (t1 <= 1.8e-42) {
tmp = (-t1 / (u * u)) * v;
} else {
tmp = t_1;
}
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 / (u + t1)
if (t1 <= (-4.6d-90)) then
tmp = t_1
else if (t1 <= 1.8d-42) then
tmp = (-t1 / (u * u)) * v
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -4.6e-90) {
tmp = t_1;
} else if (t1 <= 1.8e-42) {
tmp = (-t1 / (u * u)) * v;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -4.6e-90: tmp = t_1 elif t1 <= 1.8e-42: tmp = (-t1 / (u * u)) * v else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -4.6e-90) tmp = t_1; elseif (t1 <= 1.8e-42) tmp = Float64(Float64(Float64(-t1) / Float64(u * u)) * v); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (u + t1); tmp = 0.0; if (t1 <= -4.6e-90) tmp = t_1; elseif (t1 <= 1.8e-42) tmp = (-t1 / (u * u)) * v; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -4.6e-90], t$95$1, If[LessEqual[t1, 1.8e-42], N[(N[((-t1) / N[(u * u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -4.6 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.8 \cdot 10^{-42}:\\
\;\;\;\;\frac{-t1}{u \cdot u} \cdot v\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -4.5999999999999996e-90 or 1.8000000000000001e-42 < t1 Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6477.5
Applied rewrites77.5%
if -4.5999999999999996e-90 < t1 < 1.8000000000000001e-42Initial program 79.4%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f6478.2
lift-+.f64N/A
+-commutativeN/A
lower-+.f6478.2
Applied rewrites78.2%
Taylor expanded in u around inf
unpow2N/A
lower-*.f6474.8
Applied rewrites74.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6474.6
Applied rewrites74.6%
Final simplification76.4%
(FPCore (u v t1)
:precision binary64
(let* ((t_1 (/ (- v) (+ u t1))))
(if (<= t1 -4.6e-90)
t_1
(if (<= t1 1.8e-42) (* (/ v (* (- u) u)) t1) t_1))))
double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -4.6e-90) {
tmp = t_1;
} else if (t1 <= 1.8e-42) {
tmp = (v / (-u * u)) * t1;
} else {
tmp = t_1;
}
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 / (u + t1)
if (t1 <= (-4.6d-90)) then
tmp = t_1
else if (t1 <= 1.8d-42) then
tmp = (v / (-u * u)) * t1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double u, double v, double t1) {
double t_1 = -v / (u + t1);
double tmp;
if (t1 <= -4.6e-90) {
tmp = t_1;
} else if (t1 <= 1.8e-42) {
tmp = (v / (-u * u)) * t1;
} else {
tmp = t_1;
}
return tmp;
}
def code(u, v, t1): t_1 = -v / (u + t1) tmp = 0 if t1 <= -4.6e-90: tmp = t_1 elif t1 <= 1.8e-42: tmp = (v / (-u * u)) * t1 else: tmp = t_1 return tmp
function code(u, v, t1) t_1 = Float64(Float64(-v) / Float64(u + t1)) tmp = 0.0 if (t1 <= -4.6e-90) tmp = t_1; elseif (t1 <= 1.8e-42) tmp = Float64(Float64(v / Float64(Float64(-u) * u)) * t1); else tmp = t_1; end return tmp end
function tmp_2 = code(u, v, t1) t_1 = -v / (u + t1); tmp = 0.0; if (t1 <= -4.6e-90) tmp = t_1; elseif (t1 <= 1.8e-42) tmp = (v / (-u * u)) * t1; else tmp = t_1; end tmp_2 = tmp; end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-v) / N[(u + t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -4.6e-90], t$95$1, If[LessEqual[t1, 1.8e-42], N[(N[(v / N[((-u) * u), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-v}{u + t1}\\
\mathbf{if}\;t1 \leq -4.6 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t1 \leq 1.8 \cdot 10^{-42}:\\
\;\;\;\;\frac{v}{\left(-u\right) \cdot u} \cdot t1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t1 < -4.5999999999999996e-90 or 1.8000000000000001e-42 < t1 Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6477.5
Applied rewrites77.5%
if -4.5999999999999996e-90 < t1 < 1.8000000000000001e-42Initial program 79.4%
Taylor expanded in u around inf
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
unpow2N/A
associate-*r*N/A
times-fracN/A
neg-mul-1N/A
lower-*.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6479.3
Applied rewrites79.3%
Applied rewrites72.1%
Final simplification75.4%
(FPCore (u v t1) :precision binary64 (/ (* (/ v (+ u t1)) t1) (- (- t1) u)))
double code(double u, double v, double t1) {
return ((v / (u + t1)) * t1) / (-t1 - u);
}
real(8) function code(u, v, t1)
real(8), intent (in) :: u
real(8), intent (in) :: v
real(8), intent (in) :: t1
code = ((v / (u + t1)) * t1) / (-t1 - u)
end function
public static double code(double u, double v, double t1) {
return ((v / (u + t1)) * t1) / (-t1 - u);
}
def code(u, v, t1): return ((v / (u + t1)) * t1) / (-t1 - u)
function code(u, v, t1) return Float64(Float64(Float64(v / Float64(u + t1)) * t1) / Float64(Float64(-t1) - u)) end
function tmp = code(u, v, t1) tmp = ((v / (u + t1)) * t1) / (-t1 - u); end
code[u_, v_, t1_] := N[(N[(N[(v / N[(u + t1), $MachinePrecision]), $MachinePrecision] * t1), $MachinePrecision] / N[((-t1) - u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{v}{u + t1} \cdot t1}{\left(-t1\right) - u}
\end{array}
Initial program 73.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6498.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.8
Applied rewrites98.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lift-neg.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-+.f64N/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6498.7
Applied rewrites98.7%
Final simplification98.7%
(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(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}
Initial program 73.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
associate-/l*N/A
lift-neg.f64N/A
frac-2negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6498.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6498.8
Applied rewrites98.8%
Taylor expanded in u around 0
mul-1-negN/A
lower-neg.f6458.4
Applied rewrites58.4%
(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(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}
Initial program 73.3%
Taylor expanded in u around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6452.2
Applied rewrites52.2%
herbie shell --seed 2024332
(FPCore (u v t1)
:name "Rosa's DopplerBench"
:precision binary64
(/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))