
(FPCore (m v) :precision binary64 (* (- (/ (* m (- 1.0 m)) v) 1.0) m))
double code(double m, double v) {
return (((m * (1.0 - m)) / v) - 1.0) * m;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
code = (((m * (1.0d0 - m)) / v) - 1.0d0) * m
end function
public static double code(double m, double v) {
return (((m * (1.0 - m)) / v) - 1.0) * m;
}
def code(m, v): return (((m * (1.0 - m)) / v) - 1.0) * m
function code(m, v) return Float64(Float64(Float64(Float64(m * Float64(1.0 - m)) / v) - 1.0) * m) end
function tmp = code(m, v) tmp = (((m * (1.0 - m)) / v) - 1.0) * m; end
code[m_, v_] := N[(N[(N[(N[(m * N[(1.0 - m), $MachinePrecision]), $MachinePrecision] / v), $MachinePrecision] - 1.0), $MachinePrecision] * m), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot m
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (m v) :precision binary64 (* (- (/ (* m (- 1.0 m)) v) 1.0) m))
double code(double m, double v) {
return (((m * (1.0 - m)) / v) - 1.0) * m;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
code = (((m * (1.0d0 - m)) / v) - 1.0d0) * m
end function
public static double code(double m, double v) {
return (((m * (1.0 - m)) / v) - 1.0) * m;
}
def code(m, v): return (((m * (1.0 - m)) / v) - 1.0) * m
function code(m, v) return Float64(Float64(Float64(Float64(m * Float64(1.0 - m)) / v) - 1.0) * m) end
function tmp = code(m, v) tmp = (((m * (1.0 - m)) / v) - 1.0) * m; end
code[m_, v_] := N[(N[(N[(N[(m * N[(1.0 - m), $MachinePrecision]), $MachinePrecision] / v), $MachinePrecision] - 1.0), $MachinePrecision] * m), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot m
\end{array}
(FPCore (m v) :precision binary64 (* m (+ (/ (* m (- 1.0 m)) v) -1.0)))
double code(double m, double v) {
return m * (((m * (1.0 - m)) / v) + -1.0);
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
code = m * (((m * (1.0d0 - m)) / v) + (-1.0d0))
end function
public static double code(double m, double v) {
return m * (((m * (1.0 - m)) / v) + -1.0);
}
def code(m, v): return m * (((m * (1.0 - m)) / v) + -1.0)
function code(m, v) return Float64(m * Float64(Float64(Float64(m * Float64(1.0 - m)) / v) + -1.0)) end
function tmp = code(m, v) tmp = m * (((m * (1.0 - m)) / v) + -1.0); end
code[m_, v_] := N[(m * N[(N[(N[(m * N[(1.0 - m), $MachinePrecision]), $MachinePrecision] / v), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
m \cdot \left(\frac{m \cdot \left(1 - m\right)}{v} + -1\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (m v)
:precision binary64
(if (<= m 2.4e-210)
(- m)
(if (<= m 8.8e-190)
(* m (/ m v))
(if (<= m 2.6e-123)
(/ (* m (- v)) v)
(if (<= m 1.0) (/ m (/ v m)) (* m (- -1.0 (/ m v))))))))
double code(double m, double v) {
double tmp;
if (m <= 2.4e-210) {
tmp = -m;
} else if (m <= 8.8e-190) {
tmp = m * (m / v);
} else if (m <= 2.6e-123) {
tmp = (m * -v) / v;
} else if (m <= 1.0) {
tmp = m / (v / m);
} else {
tmp = m * (-1.0 - (m / v));
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (m <= 2.4d-210) then
tmp = -m
else if (m <= 8.8d-190) then
tmp = m * (m / v)
else if (m <= 2.6d-123) then
tmp = (m * -v) / v
else if (m <= 1.0d0) then
tmp = m / (v / m)
else
tmp = m * ((-1.0d0) - (m / v))
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 2.4e-210) {
tmp = -m;
} else if (m <= 8.8e-190) {
tmp = m * (m / v);
} else if (m <= 2.6e-123) {
tmp = (m * -v) / v;
} else if (m <= 1.0) {
tmp = m / (v / m);
} else {
tmp = m * (-1.0 - (m / v));
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 2.4e-210: tmp = -m elif m <= 8.8e-190: tmp = m * (m / v) elif m <= 2.6e-123: tmp = (m * -v) / v elif m <= 1.0: tmp = m / (v / m) else: tmp = m * (-1.0 - (m / v)) return tmp
function code(m, v) tmp = 0.0 if (m <= 2.4e-210) tmp = Float64(-m); elseif (m <= 8.8e-190) tmp = Float64(m * Float64(m / v)); elseif (m <= 2.6e-123) tmp = Float64(Float64(m * Float64(-v)) / v); elseif (m <= 1.0) tmp = Float64(m / Float64(v / m)); else tmp = Float64(m * Float64(-1.0 - Float64(m / v))); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 2.4e-210) tmp = -m; elseif (m <= 8.8e-190) tmp = m * (m / v); elseif (m <= 2.6e-123) tmp = (m * -v) / v; elseif (m <= 1.0) tmp = m / (v / m); else tmp = m * (-1.0 - (m / v)); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 2.4e-210], (-m), If[LessEqual[m, 8.8e-190], N[(m * N[(m / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 2.6e-123], N[(N[(m * (-v)), $MachinePrecision] / v), $MachinePrecision], If[LessEqual[m, 1.0], N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision], N[(m * N[(-1.0 - N[(m / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.4 \cdot 10^{-210}:\\
\;\;\;\;-m\\
\mathbf{elif}\;m \leq 8.8 \cdot 10^{-190}:\\
\;\;\;\;m \cdot \frac{m}{v}\\
\mathbf{elif}\;m \leq 2.6 \cdot 10^{-123}:\\
\;\;\;\;\frac{m \cdot \left(-v\right)}{v}\\
\mathbf{elif}\;m \leq 1:\\
\;\;\;\;\frac{m}{\frac{v}{m}}\\
\mathbf{else}:\\
\;\;\;\;m \cdot \left(-1 - \frac{m}{v}\right)\\
\end{array}
\end{array}
if m < 2.40000000000000004e-210Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 88.1%
neg-mul-188.1%
Simplified88.1%
if 2.40000000000000004e-210 < m < 8.80000000000000017e-190Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-/l*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in m around 0 99.6%
Taylor expanded in m around inf 4.9%
unpow229.8%
associate-*l/100.0%
Applied egg-rr67.5%
if 8.80000000000000017e-190 < m < 2.59999999999999995e-123Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
distribute-lft-in99.9%
*-commutative99.9%
neg-mul-199.9%
unsub-neg99.9%
associate-/l*96.2%
unpow296.2%
Simplified96.2%
unpow296.2%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in v around 0 96.2%
associate-*r*96.2%
neg-mul-196.2%
unpow296.2%
sqr-neg96.2%
distribute-lft-out96.2%
unsub-neg96.2%
Simplified96.2%
Taylor expanded in m around 0 85.2%
associate-*r*85.2%
mul-1-neg85.2%
Simplified85.2%
if 2.59999999999999995e-123 < m < 1Initial program 99.6%
*-commutative99.6%
sub-neg99.6%
associate-/l*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in m around 0 96.2%
Taylor expanded in m around inf 77.0%
unpow296.5%
associate-*l/96.5%
Applied egg-rr77.0%
*-commutative96.5%
clear-num96.2%
un-div-inv96.6%
Applied egg-rr77.1%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
neg-mul-10.1%
unsub-neg0.1%
associate-/l*0.1%
unpow20.1%
Simplified0.1%
unpow20.1%
associate-*l/0.1%
Applied egg-rr0.1%
frac-2neg0.1%
associate-*l/0.1%
add-sqr-sqrt0.0%
sqrt-unprod72.3%
sqr-neg72.3%
sqrt-unprod68.1%
add-sqr-sqrt68.1%
Applied egg-rr68.1%
Taylor expanded in m around 0 68.1%
sub-neg68.1%
metadata-eval68.1%
+-commutative68.1%
mul-1-neg68.1%
unsub-neg68.1%
Simplified68.1%
Final simplification75.0%
(FPCore (m v)
:precision binary64
(if (<= m 2.5e-210)
(- m)
(if (<= m 1.02e-190)
(* m (/ m v))
(if (<= m 4.2e-123)
(/ (* m (- v)) v)
(if (<= m 1.0) (/ m (/ v m)) (/ (- (* m m)) v))))))
double code(double m, double v) {
double tmp;
if (m <= 2.5e-210) {
tmp = -m;
} else if (m <= 1.02e-190) {
tmp = m * (m / v);
} else if (m <= 4.2e-123) {
tmp = (m * -v) / v;
} else if (m <= 1.0) {
tmp = m / (v / m);
} else {
tmp = -(m * m) / v;
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (m <= 2.5d-210) then
tmp = -m
else if (m <= 1.02d-190) then
tmp = m * (m / v)
else if (m <= 4.2d-123) then
tmp = (m * -v) / v
else if (m <= 1.0d0) then
tmp = m / (v / m)
else
tmp = -(m * m) / v
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 2.5e-210) {
tmp = -m;
} else if (m <= 1.02e-190) {
tmp = m * (m / v);
} else if (m <= 4.2e-123) {
tmp = (m * -v) / v;
} else if (m <= 1.0) {
tmp = m / (v / m);
} else {
tmp = -(m * m) / v;
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 2.5e-210: tmp = -m elif m <= 1.02e-190: tmp = m * (m / v) elif m <= 4.2e-123: tmp = (m * -v) / v elif m <= 1.0: tmp = m / (v / m) else: tmp = -(m * m) / v return tmp
function code(m, v) tmp = 0.0 if (m <= 2.5e-210) tmp = Float64(-m); elseif (m <= 1.02e-190) tmp = Float64(m * Float64(m / v)); elseif (m <= 4.2e-123) tmp = Float64(Float64(m * Float64(-v)) / v); elseif (m <= 1.0) tmp = Float64(m / Float64(v / m)); else tmp = Float64(Float64(-Float64(m * m)) / v); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 2.5e-210) tmp = -m; elseif (m <= 1.02e-190) tmp = m * (m / v); elseif (m <= 4.2e-123) tmp = (m * -v) / v; elseif (m <= 1.0) tmp = m / (v / m); else tmp = -(m * m) / v; end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 2.5e-210], (-m), If[LessEqual[m, 1.02e-190], N[(m * N[(m / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 4.2e-123], N[(N[(m * (-v)), $MachinePrecision] / v), $MachinePrecision], If[LessEqual[m, 1.0], N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision], N[((-N[(m * m), $MachinePrecision]) / v), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.5 \cdot 10^{-210}:\\
\;\;\;\;-m\\
\mathbf{elif}\;m \leq 1.02 \cdot 10^{-190}:\\
\;\;\;\;m \cdot \frac{m}{v}\\
\mathbf{elif}\;m \leq 4.2 \cdot 10^{-123}:\\
\;\;\;\;\frac{m \cdot \left(-v\right)}{v}\\
\mathbf{elif}\;m \leq 1:\\
\;\;\;\;\frac{m}{\frac{v}{m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-m \cdot m}{v}\\
\end{array}
\end{array}
if m < 2.5000000000000001e-210Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 88.1%
neg-mul-188.1%
Simplified88.1%
if 2.5000000000000001e-210 < m < 1.02e-190Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-/l*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in m around 0 99.6%
Taylor expanded in m around inf 4.9%
unpow229.8%
associate-*l/100.0%
Applied egg-rr67.5%
if 1.02e-190 < m < 4.1999999999999998e-123Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 99.9%
sub-neg99.9%
metadata-eval99.9%
distribute-lft-in99.9%
*-commutative99.9%
neg-mul-199.9%
unsub-neg99.9%
associate-/l*96.2%
unpow296.2%
Simplified96.2%
unpow296.2%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in v around 0 96.2%
associate-*r*96.2%
neg-mul-196.2%
unpow296.2%
sqr-neg96.2%
distribute-lft-out96.2%
unsub-neg96.2%
Simplified96.2%
Taylor expanded in m around 0 85.2%
associate-*r*85.2%
mul-1-neg85.2%
Simplified85.2%
if 4.1999999999999998e-123 < m < 1Initial program 99.6%
*-commutative99.6%
sub-neg99.6%
associate-/l*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in m around 0 96.2%
Taylor expanded in m around inf 77.0%
unpow296.5%
associate-*l/96.5%
Applied egg-rr77.0%
*-commutative96.5%
clear-num96.2%
un-div-inv96.6%
Applied egg-rr77.1%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 0.1%
Taylor expanded in m around inf 0.1%
unpow20.1%
associate-*l/0.1%
Applied egg-rr0.1%
frac-2neg0.1%
associate-*l/0.1%
add-sqr-sqrt0.0%
sqrt-unprod72.3%
sqr-neg72.3%
sqrt-unprod68.1%
add-sqr-sqrt68.1%
Applied egg-rr68.1%
Final simplification75.0%
(FPCore (m v)
:precision binary64
(if (<= m 2.45e-210)
(- m)
(if (<= m 1.22e-191)
(* m (/ m v))
(if (<= m 5.3e-123)
(- m)
(if (<= m 1.0) (/ m (/ v m)) (/ (- (* m m)) v))))))
double code(double m, double v) {
double tmp;
if (m <= 2.45e-210) {
tmp = -m;
} else if (m <= 1.22e-191) {
tmp = m * (m / v);
} else if (m <= 5.3e-123) {
tmp = -m;
} else if (m <= 1.0) {
tmp = m / (v / m);
} else {
tmp = -(m * m) / v;
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (m <= 2.45d-210) then
tmp = -m
else if (m <= 1.22d-191) then
tmp = m * (m / v)
else if (m <= 5.3d-123) then
tmp = -m
else if (m <= 1.0d0) then
tmp = m / (v / m)
else
tmp = -(m * m) / v
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 2.45e-210) {
tmp = -m;
} else if (m <= 1.22e-191) {
tmp = m * (m / v);
} else if (m <= 5.3e-123) {
tmp = -m;
} else if (m <= 1.0) {
tmp = m / (v / m);
} else {
tmp = -(m * m) / v;
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 2.45e-210: tmp = -m elif m <= 1.22e-191: tmp = m * (m / v) elif m <= 5.3e-123: tmp = -m elif m <= 1.0: tmp = m / (v / m) else: tmp = -(m * m) / v return tmp
function code(m, v) tmp = 0.0 if (m <= 2.45e-210) tmp = Float64(-m); elseif (m <= 1.22e-191) tmp = Float64(m * Float64(m / v)); elseif (m <= 5.3e-123) tmp = Float64(-m); elseif (m <= 1.0) tmp = Float64(m / Float64(v / m)); else tmp = Float64(Float64(-Float64(m * m)) / v); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 2.45e-210) tmp = -m; elseif (m <= 1.22e-191) tmp = m * (m / v); elseif (m <= 5.3e-123) tmp = -m; elseif (m <= 1.0) tmp = m / (v / m); else tmp = -(m * m) / v; end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 2.45e-210], (-m), If[LessEqual[m, 1.22e-191], N[(m * N[(m / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5.3e-123], (-m), If[LessEqual[m, 1.0], N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision], N[((-N[(m * m), $MachinePrecision]) / v), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.45 \cdot 10^{-210}:\\
\;\;\;\;-m\\
\mathbf{elif}\;m \leq 1.22 \cdot 10^{-191}:\\
\;\;\;\;m \cdot \frac{m}{v}\\
\mathbf{elif}\;m \leq 5.3 \cdot 10^{-123}:\\
\;\;\;\;-m\\
\mathbf{elif}\;m \leq 1:\\
\;\;\;\;\frac{m}{\frac{v}{m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-m \cdot m}{v}\\
\end{array}
\end{array}
if m < 2.4499999999999999e-210 or 1.22e-191 < m < 5.29999999999999971e-123Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 87.0%
neg-mul-187.0%
Simplified87.0%
if 2.4499999999999999e-210 < m < 1.22e-191Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-/l*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in m around 0 99.6%
Taylor expanded in m around inf 4.9%
unpow229.8%
associate-*l/100.0%
Applied egg-rr67.5%
if 5.29999999999999971e-123 < m < 1Initial program 99.6%
*-commutative99.6%
sub-neg99.6%
associate-/l*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in m around 0 96.2%
Taylor expanded in m around inf 77.0%
unpow296.5%
associate-*l/96.5%
Applied egg-rr77.0%
*-commutative96.5%
clear-num96.2%
un-div-inv96.6%
Applied egg-rr77.1%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 0.1%
Taylor expanded in m around inf 0.1%
unpow20.1%
associate-*l/0.1%
Applied egg-rr0.1%
frac-2neg0.1%
associate-*l/0.1%
add-sqr-sqrt0.0%
sqrt-unprod72.3%
sqr-neg72.3%
sqrt-unprod68.1%
add-sqr-sqrt68.1%
Applied egg-rr68.1%
Final simplification75.0%
(FPCore (m v)
:precision binary64
(if (<= m 2.5e-210)
(- m)
(if (<= m 1.22e-191)
(* m (/ m v))
(if (<= m 1.1e-122)
(- m)
(if (<= m 1.0) (/ m (/ v m)) (/ m (/ v (- m))))))))
double code(double m, double v) {
double tmp;
if (m <= 2.5e-210) {
tmp = -m;
} else if (m <= 1.22e-191) {
tmp = m * (m / v);
} else if (m <= 1.1e-122) {
tmp = -m;
} else if (m <= 1.0) {
tmp = m / (v / m);
} else {
tmp = m / (v / -m);
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (m <= 2.5d-210) then
tmp = -m
else if (m <= 1.22d-191) then
tmp = m * (m / v)
else if (m <= 1.1d-122) then
tmp = -m
else if (m <= 1.0d0) then
tmp = m / (v / m)
else
tmp = m / (v / -m)
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 2.5e-210) {
tmp = -m;
} else if (m <= 1.22e-191) {
tmp = m * (m / v);
} else if (m <= 1.1e-122) {
tmp = -m;
} else if (m <= 1.0) {
tmp = m / (v / m);
} else {
tmp = m / (v / -m);
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 2.5e-210: tmp = -m elif m <= 1.22e-191: tmp = m * (m / v) elif m <= 1.1e-122: tmp = -m elif m <= 1.0: tmp = m / (v / m) else: tmp = m / (v / -m) return tmp
function code(m, v) tmp = 0.0 if (m <= 2.5e-210) tmp = Float64(-m); elseif (m <= 1.22e-191) tmp = Float64(m * Float64(m / v)); elseif (m <= 1.1e-122) tmp = Float64(-m); elseif (m <= 1.0) tmp = Float64(m / Float64(v / m)); else tmp = Float64(m / Float64(v / Float64(-m))); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 2.5e-210) tmp = -m; elseif (m <= 1.22e-191) tmp = m * (m / v); elseif (m <= 1.1e-122) tmp = -m; elseif (m <= 1.0) tmp = m / (v / m); else tmp = m / (v / -m); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 2.5e-210], (-m), If[LessEqual[m, 1.22e-191], N[(m * N[(m / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 1.1e-122], (-m), If[LessEqual[m, 1.0], N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision], N[(m / N[(v / (-m)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.5 \cdot 10^{-210}:\\
\;\;\;\;-m\\
\mathbf{elif}\;m \leq 1.22 \cdot 10^{-191}:\\
\;\;\;\;m \cdot \frac{m}{v}\\
\mathbf{elif}\;m \leq 1.1 \cdot 10^{-122}:\\
\;\;\;\;-m\\
\mathbf{elif}\;m \leq 1:\\
\;\;\;\;\frac{m}{\frac{v}{m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{m}{\frac{v}{-m}}\\
\end{array}
\end{array}
if m < 2.5000000000000001e-210 or 1.22e-191 < m < 1.1e-122Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 87.0%
neg-mul-187.0%
Simplified87.0%
if 2.5000000000000001e-210 < m < 1.22e-191Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-/l*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in m around 0 99.6%
Taylor expanded in m around inf 4.9%
unpow229.8%
associate-*l/100.0%
Applied egg-rr67.5%
if 1.1e-122 < m < 1Initial program 99.6%
*-commutative99.6%
sub-neg99.6%
associate-/l*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in m around 0 96.2%
Taylor expanded in m around inf 77.0%
unpow296.5%
associate-*l/96.5%
Applied egg-rr77.0%
*-commutative96.5%
clear-num96.2%
un-div-inv96.6%
Applied egg-rr77.1%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 0.1%
Taylor expanded in m around inf 0.1%
unpow20.1%
associate-*l/0.1%
Applied egg-rr0.1%
add-sqr-sqrt0.1%
sqrt-unprod0.1%
sqr-neg0.1%
distribute-frac-neg20.1%
distribute-frac-neg20.1%
sqrt-unprod0.0%
add-sqr-sqrt68.1%
associate-/r/68.1%
frac-2neg68.1%
distribute-frac-neg68.1%
remove-double-neg68.1%
Applied egg-rr68.1%
Final simplification75.0%
(FPCore (m v) :precision binary64 (let* ((t_0 (/ m (/ v m)))) (if (<= m 1.0) (- t_0 m) (* m (- -1.0 t_0)))))
double code(double m, double v) {
double t_0 = m / (v / m);
double tmp;
if (m <= 1.0) {
tmp = t_0 - m;
} else {
tmp = m * (-1.0 - t_0);
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: t_0
real(8) :: tmp
t_0 = m / (v / m)
if (m <= 1.0d0) then
tmp = t_0 - m
else
tmp = m * ((-1.0d0) - t_0)
end if
code = tmp
end function
public static double code(double m, double v) {
double t_0 = m / (v / m);
double tmp;
if (m <= 1.0) {
tmp = t_0 - m;
} else {
tmp = m * (-1.0 - t_0);
}
return tmp;
}
def code(m, v): t_0 = m / (v / m) tmp = 0 if m <= 1.0: tmp = t_0 - m else: tmp = m * (-1.0 - t_0) return tmp
function code(m, v) t_0 = Float64(m / Float64(v / m)) tmp = 0.0 if (m <= 1.0) tmp = Float64(t_0 - m); else tmp = Float64(m * Float64(-1.0 - t_0)); end return tmp end
function tmp_2 = code(m, v) t_0 = m / (v / m); tmp = 0.0; if (m <= 1.0) tmp = t_0 - m; else tmp = m * (-1.0 - t_0); end tmp_2 = tmp; end
code[m_, v_] := Block[{t$95$0 = N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, 1.0], N[(t$95$0 - m), $MachinePrecision], N[(m * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{m}{\frac{v}{m}}\\
\mathbf{if}\;m \leq 1:\\
\;\;\;\;t\_0 - m\\
\mathbf{else}:\\
\;\;\;\;m \cdot \left(-1 - t\_0\right)\\
\end{array}
\end{array}
if m < 1Initial program 99.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 98.8%
sub-neg98.8%
metadata-eval98.8%
distribute-lft-in98.8%
*-commutative98.8%
neg-mul-198.8%
unsub-neg98.8%
associate-/l*87.5%
unpow287.5%
Simplified87.5%
unpow287.5%
associate-*l/98.8%
Applied egg-rr98.8%
*-commutative98.8%
clear-num98.7%
un-div-inv98.9%
Applied egg-rr98.9%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in m around inf 98.4%
associate-*r/98.4%
neg-mul-198.4%
Simplified98.4%
Final simplification98.6%
(FPCore (m v) :precision binary64 (if (<= m 1.0) (- (/ m (/ v m)) m) (* m (- -1.0 (* m (/ m v))))))
double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = (m / (v / m)) - m;
} else {
tmp = m * (-1.0 - (m * (m / v)));
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (m <= 1.0d0) then
tmp = (m / (v / m)) - m
else
tmp = m * ((-1.0d0) - (m * (m / v)))
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = (m / (v / m)) - m;
} else {
tmp = m * (-1.0 - (m * (m / v)));
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1.0: tmp = (m / (v / m)) - m else: tmp = m * (-1.0 - (m * (m / v))) return tmp
function code(m, v) tmp = 0.0 if (m <= 1.0) tmp = Float64(Float64(m / Float64(v / m)) - m); else tmp = Float64(m * Float64(-1.0 - Float64(m * Float64(m / v)))); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 1.0) tmp = (m / (v / m)) - m; else tmp = m * (-1.0 - (m * (m / v))); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 1.0], N[(N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision], N[(m * N[(-1.0 - N[(m * N[(m / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1:\\
\;\;\;\;\frac{m}{\frac{v}{m}} - m\\
\mathbf{else}:\\
\;\;\;\;m \cdot \left(-1 - m \cdot \frac{m}{v}\right)\\
\end{array}
\end{array}
if m < 1Initial program 99.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 98.8%
sub-neg98.8%
metadata-eval98.8%
distribute-lft-in98.8%
*-commutative98.8%
neg-mul-198.8%
unsub-neg98.8%
associate-/l*87.5%
unpow287.5%
Simplified87.5%
unpow287.5%
associate-*l/98.8%
Applied egg-rr98.8%
*-commutative98.8%
clear-num98.7%
un-div-inv98.9%
Applied egg-rr98.9%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around inf 98.4%
neg-mul-198.4%
distribute-neg-frac298.4%
Simplified98.4%
Final simplification98.6%
(FPCore (m v) :precision binary64 (if (<= m 1.0) (- (/ m (/ v m)) m) (- (- m) (/ (* m m) v))))
double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = (m / (v / m)) - m;
} else {
tmp = -m - ((m * m) / v);
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (m <= 1.0d0) then
tmp = (m / (v / m)) - m
else
tmp = -m - ((m * m) / v)
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = (m / (v / m)) - m;
} else {
tmp = -m - ((m * m) / v);
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1.0: tmp = (m / (v / m)) - m else: tmp = -m - ((m * m) / v) return tmp
function code(m, v) tmp = 0.0 if (m <= 1.0) tmp = Float64(Float64(m / Float64(v / m)) - m); else tmp = Float64(Float64(-m) - Float64(Float64(m * m) / v)); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 1.0) tmp = (m / (v / m)) - m; else tmp = -m - ((m * m) / v); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 1.0], N[(N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision], N[((-m) - N[(N[(m * m), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1:\\
\;\;\;\;\frac{m}{\frac{v}{m}} - m\\
\mathbf{else}:\\
\;\;\;\;\left(-m\right) - \frac{m \cdot m}{v}\\
\end{array}
\end{array}
if m < 1Initial program 99.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 98.8%
sub-neg98.8%
metadata-eval98.8%
distribute-lft-in98.8%
*-commutative98.8%
neg-mul-198.8%
unsub-neg98.8%
associate-/l*87.5%
unpow287.5%
Simplified87.5%
unpow287.5%
associate-*l/98.8%
Applied egg-rr98.8%
*-commutative98.8%
clear-num98.7%
un-div-inv98.9%
Applied egg-rr98.9%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
neg-mul-10.1%
unsub-neg0.1%
associate-/l*0.1%
unpow20.1%
Simplified0.1%
unpow20.1%
associate-*l/0.1%
Applied egg-rr0.1%
frac-2neg0.1%
associate-*l/0.1%
add-sqr-sqrt0.0%
sqrt-unprod72.3%
sqr-neg72.3%
sqrt-unprod68.1%
add-sqr-sqrt68.1%
Applied egg-rr68.1%
Final simplification83.4%
(FPCore (m v) :precision binary64 (let* ((t_0 (/ m (/ v m)))) (if (<= m 1.0) (- t_0 m) (- (- m) t_0))))
double code(double m, double v) {
double t_0 = m / (v / m);
double tmp;
if (m <= 1.0) {
tmp = t_0 - m;
} else {
tmp = -m - t_0;
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: t_0
real(8) :: tmp
t_0 = m / (v / m)
if (m <= 1.0d0) then
tmp = t_0 - m
else
tmp = -m - t_0
end if
code = tmp
end function
public static double code(double m, double v) {
double t_0 = m / (v / m);
double tmp;
if (m <= 1.0) {
tmp = t_0 - m;
} else {
tmp = -m - t_0;
}
return tmp;
}
def code(m, v): t_0 = m / (v / m) tmp = 0 if m <= 1.0: tmp = t_0 - m else: tmp = -m - t_0 return tmp
function code(m, v) t_0 = Float64(m / Float64(v / m)) tmp = 0.0 if (m <= 1.0) tmp = Float64(t_0 - m); else tmp = Float64(Float64(-m) - t_0); end return tmp end
function tmp_2 = code(m, v) t_0 = m / (v / m); tmp = 0.0; if (m <= 1.0) tmp = t_0 - m; else tmp = -m - t_0; end tmp_2 = tmp; end
code[m_, v_] := Block[{t$95$0 = N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, 1.0], N[(t$95$0 - m), $MachinePrecision], N[((-m) - t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{m}{\frac{v}{m}}\\
\mathbf{if}\;m \leq 1:\\
\;\;\;\;t\_0 - m\\
\mathbf{else}:\\
\;\;\;\;\left(-m\right) - t\_0\\
\end{array}
\end{array}
if m < 1Initial program 99.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 98.8%
sub-neg98.8%
metadata-eval98.8%
distribute-lft-in98.8%
*-commutative98.8%
neg-mul-198.8%
unsub-neg98.8%
associate-/l*87.5%
unpow287.5%
Simplified87.5%
unpow287.5%
associate-*l/98.8%
Applied egg-rr98.8%
*-commutative98.8%
clear-num98.7%
un-div-inv98.9%
Applied egg-rr98.9%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
neg-mul-10.1%
unsub-neg0.1%
associate-/l*0.1%
unpow20.1%
Simplified0.1%
unpow20.1%
associate-*l/0.1%
Applied egg-rr0.1%
add-sqr-sqrt0.1%
sqrt-unprod0.1%
sqr-neg0.1%
distribute-frac-neg20.1%
distribute-frac-neg20.1%
sqrt-unprod0.0%
add-sqr-sqrt68.1%
associate-/r/68.1%
frac-2neg68.1%
distribute-frac-neg68.1%
remove-double-neg68.1%
Applied egg-rr68.1%
Final simplification83.4%
(FPCore (m v) :precision binary64 (if (<= m 1.0) (- (/ m (/ v m)) m) (* m (- -1.0 (/ m v)))))
double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = (m / (v / m)) - m;
} else {
tmp = m * (-1.0 - (m / v));
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (m <= 1.0d0) then
tmp = (m / (v / m)) - m
else
tmp = m * ((-1.0d0) - (m / v))
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = (m / (v / m)) - m;
} else {
tmp = m * (-1.0 - (m / v));
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1.0: tmp = (m / (v / m)) - m else: tmp = m * (-1.0 - (m / v)) return tmp
function code(m, v) tmp = 0.0 if (m <= 1.0) tmp = Float64(Float64(m / Float64(v / m)) - m); else tmp = Float64(m * Float64(-1.0 - Float64(m / v))); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 1.0) tmp = (m / (v / m)) - m; else tmp = m * (-1.0 - (m / v)); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 1.0], N[(N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision], N[(m * N[(-1.0 - N[(m / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1:\\
\;\;\;\;\frac{m}{\frac{v}{m}} - m\\
\mathbf{else}:\\
\;\;\;\;m \cdot \left(-1 - \frac{m}{v}\right)\\
\end{array}
\end{array}
if m < 1Initial program 99.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 98.8%
sub-neg98.8%
metadata-eval98.8%
distribute-lft-in98.8%
*-commutative98.8%
neg-mul-198.8%
unsub-neg98.8%
associate-/l*87.5%
unpow287.5%
Simplified87.5%
unpow287.5%
associate-*l/98.8%
Applied egg-rr98.8%
*-commutative98.8%
clear-num98.7%
un-div-inv98.9%
Applied egg-rr98.9%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
neg-mul-10.1%
unsub-neg0.1%
associate-/l*0.1%
unpow20.1%
Simplified0.1%
unpow20.1%
associate-*l/0.1%
Applied egg-rr0.1%
frac-2neg0.1%
associate-*l/0.1%
add-sqr-sqrt0.0%
sqrt-unprod72.3%
sqr-neg72.3%
sqrt-unprod68.1%
add-sqr-sqrt68.1%
Applied egg-rr68.1%
Taylor expanded in m around 0 68.1%
sub-neg68.1%
metadata-eval68.1%
+-commutative68.1%
mul-1-neg68.1%
unsub-neg68.1%
Simplified68.1%
(FPCore (m v) :precision binary64 (if (<= m 1.0) (- (* m (/ m v)) m) (* m (- -1.0 (/ m v)))))
double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = (m * (m / v)) - m;
} else {
tmp = m * (-1.0 - (m / v));
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (m <= 1.0d0) then
tmp = (m * (m / v)) - m
else
tmp = m * ((-1.0d0) - (m / v))
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = (m * (m / v)) - m;
} else {
tmp = m * (-1.0 - (m / v));
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1.0: tmp = (m * (m / v)) - m else: tmp = m * (-1.0 - (m / v)) return tmp
function code(m, v) tmp = 0.0 if (m <= 1.0) tmp = Float64(Float64(m * Float64(m / v)) - m); else tmp = Float64(m * Float64(-1.0 - Float64(m / v))); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 1.0) tmp = (m * (m / v)) - m; else tmp = m * (-1.0 - (m / v)); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 1.0], N[(N[(m * N[(m / v), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision], N[(m * N[(-1.0 - N[(m / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1:\\
\;\;\;\;m \cdot \frac{m}{v} - m\\
\mathbf{else}:\\
\;\;\;\;m \cdot \left(-1 - \frac{m}{v}\right)\\
\end{array}
\end{array}
if m < 1Initial program 99.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 98.8%
sub-neg98.8%
metadata-eval98.8%
distribute-lft-in98.8%
*-commutative98.8%
neg-mul-198.8%
unsub-neg98.8%
associate-/l*87.5%
unpow287.5%
Simplified87.5%
unpow287.5%
associate-*l/98.8%
Applied egg-rr98.8%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
neg-mul-10.1%
unsub-neg0.1%
associate-/l*0.1%
unpow20.1%
Simplified0.1%
unpow20.1%
associate-*l/0.1%
Applied egg-rr0.1%
frac-2neg0.1%
associate-*l/0.1%
add-sqr-sqrt0.0%
sqrt-unprod72.3%
sqr-neg72.3%
sqrt-unprod68.1%
add-sqr-sqrt68.1%
Applied egg-rr68.1%
Taylor expanded in m around 0 68.1%
sub-neg68.1%
metadata-eval68.1%
+-commutative68.1%
mul-1-neg68.1%
unsub-neg68.1%
Simplified68.1%
Final simplification83.3%
(FPCore (m v) :precision binary64 (if (<= m 1.0) (* m (+ -1.0 (/ m v))) (* m (- -1.0 (/ m v)))))
double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = m * (-1.0 + (m / v));
} else {
tmp = m * (-1.0 - (m / v));
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (m <= 1.0d0) then
tmp = m * ((-1.0d0) + (m / v))
else
tmp = m * ((-1.0d0) - (m / v))
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = m * (-1.0 + (m / v));
} else {
tmp = m * (-1.0 - (m / v));
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1.0: tmp = m * (-1.0 + (m / v)) else: tmp = m * (-1.0 - (m / v)) return tmp
function code(m, v) tmp = 0.0 if (m <= 1.0) tmp = Float64(m * Float64(-1.0 + Float64(m / v))); else tmp = Float64(m * Float64(-1.0 - Float64(m / v))); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 1.0) tmp = m * (-1.0 + (m / v)); else tmp = m * (-1.0 - (m / v)); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 1.0], N[(m * N[(-1.0 + N[(m / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(m * N[(-1.0 - N[(m / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1:\\
\;\;\;\;m \cdot \left(-1 + \frac{m}{v}\right)\\
\mathbf{else}:\\
\;\;\;\;m \cdot \left(-1 - \frac{m}{v}\right)\\
\end{array}
\end{array}
if m < 1Initial program 99.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 98.8%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 0.1%
sub-neg0.1%
metadata-eval0.1%
distribute-lft-in0.1%
*-commutative0.1%
neg-mul-10.1%
unsub-neg0.1%
associate-/l*0.1%
unpow20.1%
Simplified0.1%
unpow20.1%
associate-*l/0.1%
Applied egg-rr0.1%
frac-2neg0.1%
associate-*l/0.1%
add-sqr-sqrt0.0%
sqrt-unprod72.3%
sqr-neg72.3%
sqrt-unprod68.1%
add-sqr-sqrt68.1%
Applied egg-rr68.1%
Taylor expanded in m around 0 68.1%
sub-neg68.1%
metadata-eval68.1%
+-commutative68.1%
mul-1-neg68.1%
unsub-neg68.1%
Simplified68.1%
Final simplification83.3%
(FPCore (m v) :precision binary64 (* m (+ (/ m (/ v (- 1.0 m))) -1.0)))
double code(double m, double v) {
return m * ((m / (v / (1.0 - m))) + -1.0);
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
code = m * ((m / (v / (1.0d0 - m))) + (-1.0d0))
end function
public static double code(double m, double v) {
return m * ((m / (v / (1.0 - m))) + -1.0);
}
def code(m, v): return m * ((m / (v / (1.0 - m))) + -1.0)
function code(m, v) return Float64(m * Float64(Float64(m / Float64(v / Float64(1.0 - m))) + -1.0)) end
function tmp = code(m, v) tmp = m * ((m / (v / (1.0 - m))) + -1.0); end
code[m_, v_] := N[(m * N[(N[(m / N[(v / N[(1.0 - m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
m \cdot \left(\frac{m}{\frac{v}{1 - m}} + -1\right)
\end{array}
Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
(FPCore (m v) :precision binary64 (* m (+ -1.0 (* m (/ (- 1.0 m) v)))))
double code(double m, double v) {
return m * (-1.0 + (m * ((1.0 - m) / v)));
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
code = m * ((-1.0d0) + (m * ((1.0d0 - m) / v)))
end function
public static double code(double m, double v) {
return m * (-1.0 + (m * ((1.0 - m) / v)));
}
def code(m, v): return m * (-1.0 + (m * ((1.0 - m) / v)))
function code(m, v) return Float64(m * Float64(-1.0 + Float64(m * Float64(Float64(1.0 - m) / v)))) end
function tmp = code(m, v) tmp = m * (-1.0 + (m * ((1.0 - m) / v))); end
code[m_, v_] := N[(m * N[(-1.0 + N[(m * N[(N[(1.0 - m), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
m \cdot \left(-1 + m \cdot \frac{1 - m}{v}\right)
\end{array}
Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (m v) :precision binary64 (if (<= v 6e-189) (/ m (/ v m)) (- m)))
double code(double m, double v) {
double tmp;
if (v <= 6e-189) {
tmp = m / (v / m);
} else {
tmp = -m;
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (v <= 6d-189) then
tmp = m / (v / m)
else
tmp = -m
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (v <= 6e-189) {
tmp = m / (v / m);
} else {
tmp = -m;
}
return tmp;
}
def code(m, v): tmp = 0 if v <= 6e-189: tmp = m / (v / m) else: tmp = -m return tmp
function code(m, v) tmp = 0.0 if (v <= 6e-189) tmp = Float64(m / Float64(v / m)); else tmp = Float64(-m); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (v <= 6e-189) tmp = m / (v / m); else tmp = -m; end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[v, 6e-189], N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision], (-m)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq 6 \cdot 10^{-189}:\\
\;\;\;\;\frac{m}{\frac{v}{m}}\\
\mathbf{else}:\\
\;\;\;\;-m\\
\end{array}
\end{array}
if v < 6e-189Initial program 99.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 46.3%
Taylor expanded in m around inf 23.7%
unpow231.2%
associate-*l/46.4%
Applied egg-rr36.4%
*-commutative46.4%
clear-num46.3%
un-div-inv46.4%
Applied egg-rr36.5%
if 6e-189 < v Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 43.8%
neg-mul-143.8%
Simplified43.8%
(FPCore (m v) :precision binary64 (if (<= v 1.35e-188) (* m (/ m v)) (- m)))
double code(double m, double v) {
double tmp;
if (v <= 1.35e-188) {
tmp = m * (m / v);
} else {
tmp = -m;
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (v <= 1.35d-188) then
tmp = m * (m / v)
else
tmp = -m
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (v <= 1.35e-188) {
tmp = m * (m / v);
} else {
tmp = -m;
}
return tmp;
}
def code(m, v): tmp = 0 if v <= 1.35e-188: tmp = m * (m / v) else: tmp = -m return tmp
function code(m, v) tmp = 0.0 if (v <= 1.35e-188) tmp = Float64(m * Float64(m / v)); else tmp = Float64(-m); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (v <= 1.35e-188) tmp = m * (m / v); else tmp = -m; end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[v, 1.35e-188], N[(m * N[(m / v), $MachinePrecision]), $MachinePrecision], (-m)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;v \leq 1.35 \cdot 10^{-188}:\\
\;\;\;\;m \cdot \frac{m}{v}\\
\mathbf{else}:\\
\;\;\;\;-m\\
\end{array}
\end{array}
if v < 1.35e-188Initial program 99.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 46.3%
Taylor expanded in m around inf 23.7%
unpow231.2%
associate-*l/46.4%
Applied egg-rr36.4%
if 1.35e-188 < v Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 43.8%
neg-mul-143.8%
Simplified43.8%
Final simplification41.0%
(FPCore (m v) :precision binary64 (- m))
double code(double m, double v) {
return -m;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
code = -m
end function
public static double code(double m, double v) {
return -m;
}
def code(m, v): return -m
function code(m, v) return Float64(-m) end
function tmp = code(m, v) tmp = -m; end
code[m_, v_] := (-m)
\begin{array}{l}
\\
-m
\end{array}
Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 32.0%
neg-mul-132.0%
Simplified32.0%
herbie shell --seed 2024103
(FPCore (m v)
:name "a parameter of renormalized beta distribution"
:precision binary64
:pre (and (and (< 0.0 m) (< 0.0 v)) (< v 0.25))
(* (- (/ (* m (- 1.0 m)) v) 1.0) m))