
(FPCore (m v) :precision binary64 (* (- (/ (* m (- 1.0 m)) v) 1.0) (- 1.0 m)))
double code(double m, double v) {
return (((m * (1.0 - m)) / v) - 1.0) * (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) * (1.0d0 - m)
end function
public static double code(double m, double v) {
return (((m * (1.0 - m)) / v) - 1.0) * (1.0 - m);
}
def code(m, v): return (((m * (1.0 - m)) / v) - 1.0) * (1.0 - m)
function code(m, v) return Float64(Float64(Float64(Float64(m * Float64(1.0 - m)) / v) - 1.0) * Float64(1.0 - m)) end
function tmp = code(m, v) tmp = (((m * (1.0 - m)) / v) - 1.0) * (1.0 - m); end
code[m_, v_] := N[(N[(N[(N[(m * N[(1.0 - m), $MachinePrecision]), $MachinePrecision] / v), $MachinePrecision] - 1.0), $MachinePrecision] * N[(1.0 - m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot \left(1 - m\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (m v) :precision binary64 (* (- (/ (* m (- 1.0 m)) v) 1.0) (- 1.0 m)))
double code(double m, double v) {
return (((m * (1.0 - m)) / v) - 1.0) * (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) * (1.0d0 - m)
end function
public static double code(double m, double v) {
return (((m * (1.0 - m)) / v) - 1.0) * (1.0 - m);
}
def code(m, v): return (((m * (1.0 - m)) / v) - 1.0) * (1.0 - m)
function code(m, v) return Float64(Float64(Float64(Float64(m * Float64(1.0 - m)) / v) - 1.0) * Float64(1.0 - m)) end
function tmp = code(m, v) tmp = (((m * (1.0 - m)) / v) - 1.0) * (1.0 - m); end
code[m_, v_] := N[(N[(N[(N[(m * N[(1.0 - m), $MachinePrecision]), $MachinePrecision] / v), $MachinePrecision] - 1.0), $MachinePrecision] * N[(1.0 - m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{m \cdot \left(1 - m\right)}{v} - 1\right) \cdot \left(1 - m\right)
\end{array}
(FPCore (m v) :precision binary64 (* (- 1.0 m) (+ (* (- 1.0 m) (/ m v)) -1.0)))
double code(double m, double v) {
return (1.0 - m) * (((1.0 - m) * (m / v)) + -1.0);
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
code = (1.0d0 - m) * (((1.0d0 - m) * (m / v)) + (-1.0d0))
end function
public static double code(double m, double v) {
return (1.0 - m) * (((1.0 - m) * (m / v)) + -1.0);
}
def code(m, v): return (1.0 - m) * (((1.0 - m) * (m / v)) + -1.0)
function code(m, v) return Float64(Float64(1.0 - m) * Float64(Float64(Float64(1.0 - m) * Float64(m / v)) + -1.0)) end
function tmp = code(m, v) tmp = (1.0 - m) * (((1.0 - m) * (m / v)) + -1.0); end
code[m_, v_] := N[(N[(1.0 - m), $MachinePrecision] * N[(N[(N[(1.0 - m), $MachinePrecision] * N[(m / v), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - m\right) \cdot \left(\left(1 - m\right) \cdot \frac{m}{v} + -1\right)
\end{array}
Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-*l/99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (m v) :precision binary64 (if (<= m 1.08e-61) (+ -1.0 (+ m (/ m v))) (/ (- m (* m m)) (/ v (- 1.0 m)))))
double code(double m, double v) {
double tmp;
if (m <= 1.08e-61) {
tmp = -1.0 + (m + (m / v));
} else {
tmp = (m - (m * m)) / (v / (1.0 - 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.08d-61) then
tmp = (-1.0d0) + (m + (m / v))
else
tmp = (m - (m * m)) / (v / (1.0d0 - m))
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 1.08e-61) {
tmp = -1.0 + (m + (m / v));
} else {
tmp = (m - (m * m)) / (v / (1.0 - m));
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1.08e-61: tmp = -1.0 + (m + (m / v)) else: tmp = (m - (m * m)) / (v / (1.0 - m)) return tmp
function code(m, v) tmp = 0.0 if (m <= 1.08e-61) tmp = Float64(-1.0 + Float64(m + Float64(m / v))); else tmp = Float64(Float64(m - Float64(m * m)) / Float64(v / Float64(1.0 - m))); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 1.08e-61) tmp = -1.0 + (m + (m / v)); else tmp = (m - (m * m)) / (v / (1.0 - m)); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 1.08e-61], N[(-1.0 + N[(m + N[(m / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(m - N[(m * m), $MachinePrecision]), $MachinePrecision] / N[(v / N[(1.0 - m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.08 \cdot 10^{-61}:\\
\;\;\;\;-1 + \left(m + \frac{m}{v}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{m - m \cdot m}{\frac{v}{1 - m}}\\
\end{array}
\end{array}
if m < 1.08000000000000008e-61Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
*-commutative99.7%
distribute-lft-in99.7%
*-rgt-identity99.7%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
if 1.08000000000000008e-61 < m Initial program 99.8%
sub-neg99.8%
distribute-rgt-in99.9%
*-un-lft-identity99.9%
Applied egg-rr99.9%
Taylor expanded in v around 0 99.9%
associate-/l*99.9%
+-commutative99.9%
unpow299.9%
mul-1-neg99.9%
sub-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (m v) :precision binary64 (if (<= m 2.4) (+ -1.0 (+ m (/ m v))) (* (* m (/ m v)) (+ m -2.0))))
double code(double m, double v) {
double tmp;
if (m <= 2.4) {
tmp = -1.0 + (m + (m / v));
} else {
tmp = (m * (m / v)) * (m + -2.0);
}
return tmp;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
real(8) :: tmp
if (m <= 2.4d0) then
tmp = (-1.0d0) + (m + (m / v))
else
tmp = (m * (m / v)) * (m + (-2.0d0))
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 2.4) {
tmp = -1.0 + (m + (m / v));
} else {
tmp = (m * (m / v)) * (m + -2.0);
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 2.4: tmp = -1.0 + (m + (m / v)) else: tmp = (m * (m / v)) * (m + -2.0) return tmp
function code(m, v) tmp = 0.0 if (m <= 2.4) tmp = Float64(-1.0 + Float64(m + Float64(m / v))); else tmp = Float64(Float64(m * Float64(m / v)) * Float64(m + -2.0)); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 2.4) tmp = -1.0 + (m + (m / v)); else tmp = (m * (m / v)) * (m + -2.0); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 2.4], N[(-1.0 + N[(m + N[(m / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(m * N[(m / v), $MachinePrecision]), $MachinePrecision] * N[(m + -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.4:\\
\;\;\;\;-1 + \left(m + \frac{m}{v}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(m \cdot \frac{m}{v}\right) \cdot \left(m + -2\right)\\
\end{array}
\end{array}
if m < 2.39999999999999991Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 98.0%
sub-neg98.0%
metadata-eval98.0%
+-commutative98.0%
*-commutative98.0%
distribute-lft-in98.0%
*-rgt-identity98.0%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
if 2.39999999999999991 < m Initial program 99.9%
flip--99.9%
associate-*r/99.8%
metadata-eval99.8%
+-commutative99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in m around inf 21.8%
unpow221.8%
cube-mult21.7%
associate-*r/21.7%
distribute-rgt-out99.1%
associate-*r/99.1%
Simplified99.1%
Final simplification98.7%
(FPCore (m v) :precision binary64 (if (<= m 1.25e-198) -1.0 (if (<= m 2.2) (/ m v) (* m (/ m v)))))
double code(double m, double v) {
double tmp;
if (m <= 1.25e-198) {
tmp = -1.0;
} else if (m <= 2.2) {
tmp = 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.25d-198) then
tmp = -1.0d0
else if (m <= 2.2d0) then
tmp = 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.25e-198) {
tmp = -1.0;
} else if (m <= 2.2) {
tmp = m / v;
} else {
tmp = m * (m / v);
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1.25e-198: tmp = -1.0 elif m <= 2.2: tmp = m / v else: tmp = m * (m / v) return tmp
function code(m, v) tmp = 0.0 if (m <= 1.25e-198) tmp = -1.0; elseif (m <= 2.2) tmp = Float64(m / v); else tmp = Float64(m * Float64(m / v)); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 1.25e-198) tmp = -1.0; elseif (m <= 2.2) tmp = m / v; else tmp = m * (m / v); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 1.25e-198], -1.0, If[LessEqual[m, 2.2], N[(m / v), $MachinePrecision], N[(m * N[(m / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.25 \cdot 10^{-198}:\\
\;\;\;\;-1\\
\mathbf{elif}\;m \leq 2.2:\\
\;\;\;\;\frac{m}{v}\\
\mathbf{else}:\\
\;\;\;\;m \cdot \frac{m}{v}\\
\end{array}
\end{array}
if m < 1.25e-198Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 87.4%
if 1.25e-198 < m < 2.2000000000000002Initial program 99.9%
Taylor expanded in m around 0 97.4%
sub-neg97.4%
distribute-rgt-in97.4%
*-un-lft-identity97.4%
sub-neg97.4%
metadata-eval97.4%
add-sqr-sqrt0.0%
sqrt-unprod97.4%
sqr-neg97.4%
sqrt-unprod97.4%
add-sqr-sqrt97.4%
sub-neg97.4%
metadata-eval97.4%
Applied egg-rr97.4%
distribute-rgt1-in97.4%
Simplified97.4%
Taylor expanded in v around 0 68.8%
Taylor expanded in m around 0 68.9%
if 2.2000000000000002 < m Initial program 99.9%
Taylor expanded in m around 0 0.1%
sub-neg0.1%
distribute-rgt-in0.1%
*-un-lft-identity0.1%
sub-neg0.1%
metadata-eval0.1%
add-sqr-sqrt0.0%
sqrt-unprod79.4%
sqr-neg79.4%
sqrt-unprod79.4%
add-sqr-sqrt79.4%
sub-neg79.4%
metadata-eval79.4%
Applied egg-rr79.4%
distribute-rgt1-in79.4%
Simplified79.4%
Taylor expanded in m around inf 79.4%
unpow279.4%
associate-*r/79.4%
Simplified79.4%
Final simplification77.3%
(FPCore (m v) :precision binary64 (if (<= m 1.15e-198) -1.0 (* (/ m v) (+ 1.0 m))))
double code(double m, double v) {
double tmp;
if (m <= 1.15e-198) {
tmp = -1.0;
} else {
tmp = (m / v) * (1.0 + 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.15d-198) then
tmp = -1.0d0
else
tmp = (m / v) * (1.0d0 + m)
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 1.15e-198) {
tmp = -1.0;
} else {
tmp = (m / v) * (1.0 + m);
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1.15e-198: tmp = -1.0 else: tmp = (m / v) * (1.0 + m) return tmp
function code(m, v) tmp = 0.0 if (m <= 1.15e-198) tmp = -1.0; else tmp = Float64(Float64(m / v) * Float64(1.0 + m)); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 1.15e-198) tmp = -1.0; else tmp = (m / v) * (1.0 + m); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 1.15e-198], -1.0, N[(N[(m / v), $MachinePrecision] * N[(1.0 + m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 1.15 \cdot 10^{-198}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;\frac{m}{v} \cdot \left(1 + m\right)\\
\end{array}
\end{array}
if m < 1.15000000000000007e-198Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 87.4%
if 1.15000000000000007e-198 < m Initial program 99.9%
Taylor expanded in m around 0 35.9%
sub-neg35.9%
distribute-rgt-in35.9%
*-un-lft-identity35.9%
sub-neg35.9%
metadata-eval35.9%
add-sqr-sqrt0.0%
sqrt-unprod86.0%
sqr-neg86.0%
sqrt-unprod86.0%
add-sqr-sqrt86.0%
sub-neg86.0%
metadata-eval86.0%
Applied egg-rr86.0%
distribute-rgt1-in86.0%
Simplified86.0%
Taylor expanded in v around 0 75.5%
associate-*l/75.5%
+-commutative75.5%
Simplified75.5%
Final simplification77.3%
(FPCore (m v) :precision binary64 (if (<= m 2.4) (+ -1.0 (+ m (/ m v))) (* (/ m v) (+ 1.0 m))))
double code(double m, double v) {
double tmp;
if (m <= 2.4) {
tmp = -1.0 + (m + (m / v));
} else {
tmp = (m / v) * (1.0 + 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.4d0) then
tmp = (-1.0d0) + (m + (m / v))
else
tmp = (m / v) * (1.0d0 + m)
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 2.4) {
tmp = -1.0 + (m + (m / v));
} else {
tmp = (m / v) * (1.0 + m);
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 2.4: tmp = -1.0 + (m + (m / v)) else: tmp = (m / v) * (1.0 + m) return tmp
function code(m, v) tmp = 0.0 if (m <= 2.4) tmp = Float64(-1.0 + Float64(m + Float64(m / v))); else tmp = Float64(Float64(m / v) * Float64(1.0 + m)); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 2.4) tmp = -1.0 + (m + (m / v)); else tmp = (m / v) * (1.0 + m); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 2.4], N[(-1.0 + N[(m + N[(m / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(m / v), $MachinePrecision] * N[(1.0 + m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.4:\\
\;\;\;\;-1 + \left(m + \frac{m}{v}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{m}{v} \cdot \left(1 + m\right)\\
\end{array}
\end{array}
if m < 2.39999999999999991Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 98.0%
sub-neg98.0%
metadata-eval98.0%
+-commutative98.0%
*-commutative98.0%
distribute-lft-in98.0%
*-rgt-identity98.0%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
if 2.39999999999999991 < m Initial program 99.9%
Taylor expanded in m around 0 0.1%
sub-neg0.1%
distribute-rgt-in0.1%
*-un-lft-identity0.1%
sub-neg0.1%
metadata-eval0.1%
add-sqr-sqrt0.0%
sqrt-unprod79.4%
sqr-neg79.4%
sqrt-unprod79.4%
add-sqr-sqrt79.4%
sub-neg79.4%
metadata-eval79.4%
Applied egg-rr79.4%
distribute-rgt1-in79.4%
Simplified79.4%
Taylor expanded in v around 0 79.4%
associate-*l/79.4%
+-commutative79.4%
Simplified79.4%
Final simplification88.2%
(FPCore (m v) :precision binary64 (if (<= m 2.6) (+ -1.0 (+ m (/ m v))) (/ (* m m) (/ v m))))
double code(double m, double v) {
double tmp;
if (m <= 2.6) {
tmp = -1.0 + (m + (m / v));
} else {
tmp = (m * 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.6d0) then
tmp = (-1.0d0) + (m + (m / v))
else
tmp = (m * m) / (v / m)
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 2.6) {
tmp = -1.0 + (m + (m / v));
} else {
tmp = (m * m) / (v / m);
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 2.6: tmp = -1.0 + (m + (m / v)) else: tmp = (m * m) / (v / m) return tmp
function code(m, v) tmp = 0.0 if (m <= 2.6) tmp = Float64(-1.0 + Float64(m + Float64(m / v))); else tmp = Float64(Float64(m * m) / Float64(v / m)); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 2.6) tmp = -1.0 + (m + (m / v)); else tmp = (m * m) / (v / m); end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 2.6], N[(-1.0 + N[(m + N[(m / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(m * m), $MachinePrecision] / N[(v / m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 2.6:\\
\;\;\;\;-1 + \left(m + \frac{m}{v}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{m \cdot m}{\frac{v}{m}}\\
\end{array}
\end{array}
if m < 2.60000000000000009Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 98.0%
sub-neg98.0%
metadata-eval98.0%
+-commutative98.0%
*-commutative98.0%
distribute-lft-in98.0%
*-rgt-identity98.0%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
if 2.60000000000000009 < 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.5%
unpow398.5%
*-un-lft-identity98.5%
times-frac98.5%
Applied egg-rr98.5%
associate-*l/98.5%
associate-/l*98.5%
clear-num98.5%
Applied egg-rr98.5%
Final simplification98.4%
(FPCore (m v) :precision binary64 (if (<= m 6e-199) -1.0 (/ m v)))
double code(double m, double v) {
double tmp;
if (m <= 6e-199) {
tmp = -1.0;
} else {
tmp = 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 <= 6d-199) then
tmp = -1.0d0
else
tmp = m / v
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 6e-199) {
tmp = -1.0;
} else {
tmp = m / v;
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 6e-199: tmp = -1.0 else: tmp = m / v return tmp
function code(m, v) tmp = 0.0 if (m <= 6e-199) tmp = -1.0; else tmp = Float64(m / v); end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 6e-199) tmp = -1.0; else tmp = m / v; end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 6e-199], -1.0, N[(m / v), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 6 \cdot 10^{-199}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;\frac{m}{v}\\
\end{array}
\end{array}
if m < 5.99999999999999966e-199Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 87.4%
if 5.99999999999999966e-199 < m Initial program 99.9%
Taylor expanded in m around 0 35.9%
sub-neg35.9%
distribute-rgt-in35.9%
*-un-lft-identity35.9%
sub-neg35.9%
metadata-eval35.9%
add-sqr-sqrt0.0%
sqrt-unprod86.0%
sqr-neg86.0%
sqrt-unprod86.0%
add-sqr-sqrt86.0%
sub-neg86.0%
metadata-eval86.0%
Applied egg-rr86.0%
distribute-rgt1-in86.0%
Simplified86.0%
Taylor expanded in v around 0 75.5%
Taylor expanded in m around 0 62.5%
Final simplification66.3%
(FPCore (m v) :precision binary64 (if (<= m 1e-61) -1.0 m))
double code(double m, double v) {
double tmp;
if (m <= 1e-61) {
tmp = -1.0;
} 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 <= 1d-61) then
tmp = -1.0d0
else
tmp = m
end if
code = tmp
end function
public static double code(double m, double v) {
double tmp;
if (m <= 1e-61) {
tmp = -1.0;
} else {
tmp = m;
}
return tmp;
}
def code(m, v): tmp = 0 if m <= 1e-61: tmp = -1.0 else: tmp = m return tmp
function code(m, v) tmp = 0.0 if (m <= 1e-61) tmp = -1.0; else tmp = m; end return tmp end
function tmp_2 = code(m, v) tmp = 0.0; if (m <= 1e-61) tmp = -1.0; else tmp = m; end tmp_2 = tmp; end
code[m_, v_] := If[LessEqual[m, 1e-61], -1.0, m]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq 10^{-61}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;m\\
\end{array}
\end{array}
if m < 1e-61Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
associate-*l/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in m around 0 54.0%
if 1e-61 < m Initial program 99.8%
flip--99.8%
associate-*r/99.8%
metadata-eval99.8%
+-commutative99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in m around inf 30.5%
+-commutative30.5%
associate-+r+30.6%
unpow230.6%
cube-mult30.5%
associate-*r/30.5%
distribute-rgt-out99.8%
associate-*r/99.9%
*-commutative99.9%
distribute-lft-in99.9%
*-rgt-identity99.9%
associate-*r/99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in v around inf 5.8%
Final simplification25.2%
(FPCore (m v) :precision binary64 (+ m -1.0))
double code(double m, double v) {
return m + -1.0;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
code = m + (-1.0d0)
end function
public static double code(double m, double v) {
return m + -1.0;
}
def code(m, v): return m + -1.0
function code(m, v) return Float64(m + -1.0) end
function tmp = code(m, v) tmp = m + -1.0; end
code[m_, v_] := N[(m + -1.0), $MachinePrecision]
\begin{array}{l}
\\
m + -1
\end{array}
Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-*l/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in v around inf 24.9%
neg-mul-124.9%
neg-sub024.9%
associate--r-24.9%
metadata-eval24.9%
Simplified24.9%
Final simplification24.9%
(FPCore (m v) :precision binary64 -1.0)
double code(double m, double v) {
return -1.0;
}
real(8) function code(m, v)
real(8), intent (in) :: m
real(8), intent (in) :: v
code = -1.0d0
end function
public static double code(double m, double v) {
return -1.0;
}
def code(m, v): return -1.0
function code(m, v) return -1.0 end
function tmp = code(m, v) tmp = -1.0; end
code[m_, v_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 99.9%
*-commutative99.9%
sub-neg99.9%
associate-*l/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in m around 0 22.2%
Final simplification22.2%
herbie shell --seed 2023178
(FPCore (m v)
:name "b 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) (- 1.0 m)))