
(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 10 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 (if (<= m 4.6e-15) (- (/ m (/ v m)) m) (* m (* (- 1.0 m) (/ m v)))))
double code(double m, double v) {
double tmp;
if (m <= 4.6e-15) {
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 <= 4.6d-15) 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 <= 4.6e-15) {
tmp = (m / (v / m)) - m;
} else {
tmp = m * ((1.0 - m) * (m / v));
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 4.6e-15: tmp = (m / (v / m)) - m else: tmp = m * ((1.0 - m) * (m / v)) return tmp
function code(m, v) tmp = 0.0 if (m <= 4.6e-15) tmp = Float64(Float64(m / Float64(v / m)) - m); else tmp = Float64(m * Float64(Float64(1.0 - m) * Float64(m / v))); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 4.6e-15) tmp = (m / (v / m)) - m; else tmp = m * ((1.0 - m) * (m / v)); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 4.6e-15], N[(N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision], N[(m * N[(N[(1.0 - m), $MachinePrecision] * N[(m / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 4.6 \cdot 10^{-15}:\\
\;\;\;\;\frac{m}{\frac{v}{m}} - m\\
\mathbf{else}:\\
\;\;\;\;m \cdot \left(\left(1 - m\right) \cdot \frac{m}{v}\right)\\
\end{array}
\end{array}
if m < 4.59999999999999981e-15Initial program 99.7%
*-commutative99.7%
sub-neg99.7%
associate-/l*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in m around 0 88.3%
neg-mul-188.3%
+-commutative88.3%
unsub-neg88.3%
unpow288.3%
associate-/l*99.8%
Simplified99.8%
if 4.59999999999999981e-15 < m Initial program 99.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in v around 0 99.8%
unpow299.8%
associate-*r*99.8%
associate-*l/99.9%
*-commutative99.9%
associate-*r*99.9%
Simplified99.9%
Final simplification99.8%
(FPCore (m v) :precision binary64 (* m (fma m (/ (- 1.0 m) v) -1.0)))
double code(double m, double v) {
return m * fma(m, ((1.0 - m) / v), -1.0);
}
function code(m, v) return Float64(m * fma(m, Float64(Float64(1.0 - m) / v), -1.0)) end
code[m_, v_] := N[(m * N[(m * N[(N[(1.0 - m), $MachinePrecision] / v), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
m \cdot \mathsf{fma}\left(m, \frac{1 - m}{v}, -1\right)
\end{array}
Initial program 99.8%
*-commutative99.8%
associate-*r/99.8%
fma-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(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.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
clear-num99.8%
associate-/r/99.8%
clear-num99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (m v) :precision binary64 (if (<= m 1.2e-123) (- m) (if (<= m 1.0) (/ m (/ v m)) (* m (/ (- m) v)))))
double code(double m, double v) {
double tmp;
if (m <= 1.2e-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 <= 1.2d-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 <= 1.2e-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 <= 1.2e-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 <= 1.2e-123) tmp = Float64(-m); elseif (m <= 1.0) tmp = Float64(m / Float64(v / m)); else tmp = Float64(m * Float64(Float64(-m) / v)); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 1.2e-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, 1.2e-123], (-m), If[LessEqual[m, 1.0], N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision], N[(m * N[((-m) / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.2 \cdot 10^{-123}:\\
\;\;\;\;-m\\
\mathbf{elif}\;m \leq 1:\\
\;\;\;\;\frac{m}{\frac{v}{m}}\\
\mathbf{else}:\\
\;\;\;\;m \cdot \frac{-m}{v}\\
\end{array}
\end{array}
if m < 1.2e-123Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 73.3%
neg-mul-173.3%
Simplified73.3%
if 1.2e-123 < m < 1Initial program 99.4%
*-commutative99.4%
sub-neg99.4%
associate-/l*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in v around 0 78.7%
associate-/l*78.7%
unpow278.7%
associate-*r/78.5%
Simplified78.5%
Taylor expanded in m around 0 76.6%
Taylor expanded in m around 0 76.8%
unpow276.8%
associate-/l*76.9%
Simplified76.9%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in v around 0 99.9%
associate-/l*99.8%
unpow299.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in m around 0 0.1%
add-sqr-sqrt0.1%
sqrt-prod0.1%
sqr-neg0.1%
sqrt-unprod0.0%
add-sqr-sqrt78.0%
distribute-lft-neg-in78.0%
Applied egg-rr78.0%
Final simplification76.3%
(FPCore (m v) :precision binary64 (if (<= m 1.0) (- (/ m (/ v m)) m) (* (/ m v) (* m (- m)))))
double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = (m / (v / m)) - m;
} else {
tmp = (m / v) * (m * -m);
}
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 / v) * (m * -m)
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 / v) * (m * -m);
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1.0: tmp = (m / (v / m)) - m else: tmp = (m / v) * (m * -m) 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 / v) * Float64(m * Float64(-m))); 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 / v) * (m * -m); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 1.0], N[(N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision], N[(N[(m / v), $MachinePrecision] * N[(m * (-m)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1:\\
\;\;\;\;\frac{m}{\frac{v}{m}} - m\\
\mathbf{else}:\\
\;\;\;\;\frac{m}{v} \cdot \left(m \cdot \left(-m\right)\right)\\
\end{array}
\end{array}
if m < 1Initial program 99.7%
*-commutative99.7%
sub-neg99.7%
associate-/l*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in m around 0 87.9%
neg-mul-187.9%
+-commutative87.9%
unsub-neg87.9%
unpow287.9%
associate-/l*99.1%
Simplified99.1%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in v around 0 99.9%
associate-/l*99.8%
unpow299.8%
associate-*r/99.8%
Simplified99.8%
*-commutative99.8%
associate-/l*99.9%
associate-*l/99.9%
Applied egg-rr99.9%
frac-2neg99.9%
distribute-frac-neg99.9%
add-sqr-sqrt99.8%
sqrt-prod99.9%
sqr-neg99.9%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
distribute-rgt-neg-in0.1%
frac-2neg0.1%
associate-/l*0.1%
div-inv0.1%
sub-neg0.1%
add-sqr-sqrt0.0%
sqrt-unprod97.6%
sqr-neg97.6%
sqrt-prod97.5%
add-sqr-sqrt97.6%
+-commutative97.6%
clear-num97.6%
Applied egg-rr97.6%
Taylor expanded in m around inf 97.7%
unpow297.7%
Simplified97.7%
Final simplification98.4%
(FPCore (m v) :precision binary64 (if (<= m 2e-115) (- m) (if (<= m 1.0) (* m (/ m v)) (- m))))
double code(double m, double v) {
double tmp;
if (m <= 2e-115) {
tmp = -m;
} else if (m <= 1.0) {
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 (m <= 2d-115) then
tmp = -m
else if (m <= 1.0d0) 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 (m <= 2e-115) {
tmp = -m;
} else if (m <= 1.0) {
tmp = m * (m / v);
} else {
tmp = -m;
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 2e-115: tmp = -m elif m <= 1.0: tmp = m * (m / v) else: tmp = -m return tmp
function code(m, v) tmp = 0.0 if (m <= 2e-115) tmp = Float64(-m); elseif (m <= 1.0) tmp = Float64(m * Float64(m / v)); else tmp = Float64(-m); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 2e-115) tmp = -m; elseif (m <= 1.0) tmp = m * (m / v); else tmp = -m; end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 2e-115], (-m), If[LessEqual[m, 1.0], N[(m * N[(m / v), $MachinePrecision]), $MachinePrecision], (-m)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2 \cdot 10^{-115}:\\
\;\;\;\;-m\\
\mathbf{elif}\;m \leq 1:\\
\;\;\;\;m \cdot \frac{m}{v}\\
\mathbf{else}:\\
\;\;\;\;-m\\
\end{array}
\end{array}
if m < 2.0000000000000001e-115 or 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 31.2%
neg-mul-131.2%
Simplified31.2%
if 2.0000000000000001e-115 < m < 1Initial program 99.4%
*-commutative99.4%
sub-neg99.4%
associate-/l*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in v around 0 80.0%
associate-/l*80.0%
unpow280.0%
associate-*r/79.8%
Simplified79.8%
Taylor expanded in m around 0 77.8%
Final simplification39.0%
(FPCore (m v) :precision binary64 (if (<= m 2.5e-126) (- m) (if (<= m 1.0) (/ m (/ v m)) (- m))))
double code(double m, double v) {
double tmp;
if (m <= 2.5e-126) {
tmp = -m;
} else if (m <= 1.0) {
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 (m <= 2.5d-126) then
tmp = -m
else if (m <= 1.0d0) 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 (m <= 2.5e-126) {
tmp = -m;
} else if (m <= 1.0) {
tmp = m / (v / m);
} else {
tmp = -m;
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 2.5e-126: tmp = -m elif m <= 1.0: tmp = m / (v / m) else: tmp = -m return tmp
function code(m, v) tmp = 0.0 if (m <= 2.5e-126) tmp = Float64(-m); elseif (m <= 1.0) tmp = Float64(m / Float64(v / m)); else tmp = Float64(-m); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 2.5e-126) tmp = -m; elseif (m <= 1.0) tmp = m / (v / m); else tmp = -m; end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 2.5e-126], (-m), If[LessEqual[m, 1.0], N[(m / N[(v / m), $MachinePrecision]), $MachinePrecision], (-m)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.5 \cdot 10^{-126}:\\
\;\;\;\;-m\\
\mathbf{elif}\;m \leq 1:\\
\;\;\;\;\frac{m}{\frac{v}{m}}\\
\mathbf{else}:\\
\;\;\;\;-m\\
\end{array}
\end{array}
if m < 2.50000000000000003e-126 or 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 31.0%
neg-mul-131.0%
Simplified31.0%
if 2.50000000000000003e-126 < m < 1Initial program 99.4%
*-commutative99.4%
sub-neg99.4%
associate-/l*99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in v around 0 78.7%
associate-/l*78.7%
unpow278.7%
associate-*r/78.5%
Simplified78.5%
Taylor expanded in m around 0 76.6%
Taylor expanded in m around 0 76.8%
unpow276.8%
associate-/l*76.9%
Simplified76.9%
Final simplification39.0%
(FPCore (m v) :precision binary64 (if (<= m 1.0) (* m (+ -1.0 (/ m v))) (* m (/ (- m) v))))
double code(double m, double v) {
double tmp;
if (m <= 1.0) {
tmp = m * (-1.0 + (m / v));
} 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 <= 1.0d0) then
tmp = m * ((-1.0d0) + (m / v))
else
tmp = 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 * (-1.0 + (m / v));
} else {
tmp = m * (-m / v);
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1.0: tmp = m * (-1.0 + (m / v)) else: tmp = m * (-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(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 * (-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[((-m) / v), $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 \frac{-m}{v}\\
\end{array}
\end{array}
if m < 1Initial program 99.7%
*-commutative99.7%
associate-*r/99.7%
fma-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in m around 0 99.0%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in v around 0 99.9%
associate-/l*99.8%
unpow299.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in m around 0 0.1%
add-sqr-sqrt0.1%
sqrt-prod0.1%
sqr-neg0.1%
sqrt-unprod0.0%
add-sqr-sqrt78.0%
distribute-lft-neg-in78.0%
Applied egg-rr78.0%
Final simplification88.2%
(FPCore (m v) :precision binary64 (if (<= m 1.0) (- (/ m (/ v 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 / 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 / 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 / v);
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1.0: tmp = (m / (v / m)) - m else: tmp = 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(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 * (-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[((-m) / v), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1:\\
\;\;\;\;\frac{m}{\frac{v}{m}} - m\\
\mathbf{else}:\\
\;\;\;\;m \cdot \frac{-m}{v}\\
\end{array}
\end{array}
if m < 1Initial program 99.7%
*-commutative99.7%
sub-neg99.7%
associate-/l*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in m around 0 87.9%
neg-mul-187.9%
+-commutative87.9%
unsub-neg87.9%
unpow287.9%
associate-/l*99.1%
Simplified99.1%
if 1 < m Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in v around 0 99.9%
associate-/l*99.8%
unpow299.8%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in m around 0 0.1%
add-sqr-sqrt0.1%
sqrt-prod0.1%
sqr-neg0.1%
sqrt-unprod0.0%
add-sqr-sqrt78.0%
distribute-lft-neg-in78.0%
Applied egg-rr78.0%
Final simplification88.2%
(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.8%
*-commutative99.8%
sub-neg99.8%
associate-/l*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in m around 0 27.9%
neg-mul-127.9%
Simplified27.9%
Final simplification27.9%
herbie shell --seed 2023271
(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))