
(FPCore (x y z t) :precision binary64 (- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return ((x * log(y)) + (z * log((1.0 - y)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * log(y)) + (z * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((x * Math.log(y)) + (z * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return ((x * math.log(y)) + (z * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(x * log(y)) + Float64(z * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = ((x * log(y)) + (z * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return ((x * log(y)) + (z * log((1.0 - y)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * log(y)) + (z * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((x * Math.log(y)) + (z * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return ((x * math.log(y)) + (z * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(x * log(y)) + Float64(z * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = ((x * log(y)) + (z * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (- (+ (* x (log y)) (* z (log1p (- 0.0 y)))) t))
double code(double x, double y, double z, double t) {
return ((x * log(y)) + (z * log1p((0.0 - y)))) - t;
}
public static double code(double x, double y, double z, double t) {
return ((x * Math.log(y)) + (z * Math.log1p((0.0 - y)))) - t;
}
def code(x, y, z, t): return ((x * math.log(y)) + (z * math.log1p((0.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(x * log(y)) + Float64(z * log1p(Float64(0.0 - y)))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Log[1 + N[(0.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \log y + z \cdot \mathsf{log1p}\left(0 - y\right)\right) - t
\end{array}
Initial program 83.0%
sub-negN/A
log1p-defineN/A
log1p-lowering-log1p.f64N/A
neg-sub0N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
(FPCore (x y z t) :precision binary64 (- (+ (* x (log y)) (* y (- (* y (* z (+ -0.5 (* y -0.3333333333333333)))) z))) t))
double code(double x, double y, double z, double t) {
return ((x * log(y)) + (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * log(y)) + (y * ((y * (z * ((-0.5d0) + (y * (-0.3333333333333333d0))))) - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((x * Math.log(y)) + (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z))) - t;
}
def code(x, y, z, t): return ((x * math.log(y)) + (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(x * log(y)) + Float64(y * Float64(Float64(y * Float64(z * Float64(-0.5 + Float64(y * -0.3333333333333333)))) - z))) - t) end
function tmp = code(x, y, z, t) tmp = ((x * log(y)) + (y * ((y * (z * (-0.5 + (y * -0.3333333333333333)))) - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(y * N[(z * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \log y + y \cdot \left(y \cdot \left(z \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right) - z\right)\right) - t
\end{array}
Initial program 83.0%
Taylor expanded in y around 0
*-commutativeN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- t_1 t))) (if (<= t -3.5e-46) t_2 (if (<= t 3.9e-104) (- t_1 (* y z)) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - t;
double tmp;
if (t <= -3.5e-46) {
tmp = t_2;
} else if (t <= 3.9e-104) {
tmp = t_1 - (y * z);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - t
if (t <= (-3.5d-46)) then
tmp = t_2
else if (t <= 3.9d-104) then
tmp = t_1 - (y * z)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - t;
double tmp;
if (t <= -3.5e-46) {
tmp = t_2;
} else if (t <= 3.9e-104) {
tmp = t_1 - (y * z);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - t tmp = 0 if t <= -3.5e-46: tmp = t_2 elif t <= 3.9e-104: tmp = t_1 - (y * z) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - t) tmp = 0.0 if (t <= -3.5e-46) tmp = t_2; elseif (t <= 3.9e-104) tmp = Float64(t_1 - Float64(y * z)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - t; tmp = 0.0; if (t <= -3.5e-46) tmp = t_2; elseif (t <= 3.9e-104) tmp = t_1 - (y * z); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - t), $MachinePrecision]}, If[LessEqual[t, -3.5e-46], t$95$2, If[LessEqual[t, 3.9e-104], N[(t$95$1 - N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - t\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{-46}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-104}:\\
\;\;\;\;t\_1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -3.5000000000000002e-46 or 3.9000000000000002e-104 < t Initial program 92.1%
Taylor expanded in y around 0
remove-double-negN/A
log-recN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
--lowering--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
*-lowering-*.f64N/A
log-lowering-log.f6491.6%
Simplified91.6%
if -3.5000000000000002e-46 < t < 3.9000000000000002e-104Initial program 71.6%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
remove-double-negN/A
log-recN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
--lowering--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
*-commutativeN/A
*-lowering-*.f6499.1%
Simplified99.1%
Taylor expanded in t around 0
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
*-lowering-*.f6490.9%
Simplified90.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) t)))
(if (<= x -3.3e-103)
t_1
(if (<= x 9e-91)
(- (* y (* z (+ -1.0 (* y (+ -0.5 (* y -0.3333333333333333)))))) t)
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - t;
double tmp;
if (x <= -3.3e-103) {
tmp = t_1;
} else if (x <= 9e-91) {
tmp = (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - t
if (x <= (-3.3d-103)) then
tmp = t_1
else if (x <= 9d-91) then
tmp = (y * (z * ((-1.0d0) + (y * ((-0.5d0) + (y * (-0.3333333333333333d0))))))) - t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * Math.log(y)) - t;
double tmp;
if (x <= -3.3e-103) {
tmp = t_1;
} else if (x <= 9e-91) {
tmp = (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - t tmp = 0 if x <= -3.3e-103: tmp = t_1 elif x <= 9e-91: tmp = (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (x <= -3.3e-103) tmp = t_1; elseif (x <= 9e-91) tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * Float64(-0.5 + Float64(y * -0.3333333333333333)))))) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - t; tmp = 0.0; if (x <= -3.3e-103) tmp = t_1; elseif (x <= 9e-91) tmp = (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[x, -3.3e-103], t$95$1, If[LessEqual[x, 9e-91], N[(N[(y * N[(z * N[(-1.0 + N[(y * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -3.3 \cdot 10^{-103}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-91}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.2999999999999999e-103 or 8.99999999999999952e-91 < x Initial program 90.0%
Taylor expanded in y around 0
remove-double-negN/A
log-recN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
--lowering--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
*-lowering-*.f64N/A
log-lowering-log.f6490.0%
Simplified90.0%
if -3.2999999999999999e-103 < x < 8.99999999999999952e-91Initial program 69.1%
Taylor expanded in y around 0
*-commutativeN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified99.5%
Taylor expanded in x around 0
--lowering--.f64N/A
Simplified89.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -2e+26)
t_1
(if (<= x 5e+72)
(- (* y (* z (+ -1.0 (* y (+ -0.5 (* y -0.3333333333333333)))))) t)
t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -2e+26) {
tmp = t_1;
} else if (x <= 5e+72) {
tmp = (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-2d+26)) then
tmp = t_1
else if (x <= 5d+72) then
tmp = (y * (z * ((-1.0d0) + (y * ((-0.5d0) + (y * (-0.3333333333333333d0))))))) - t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if (x <= -2e+26) {
tmp = t_1;
} else if (x <= 5e+72) {
tmp = (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -2e+26: tmp = t_1 elif x <= 5e+72: tmp = (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -2e+26) tmp = t_1; elseif (x <= 5e+72) tmp = Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * Float64(-0.5 + Float64(y * -0.3333333333333333)))))) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -2e+26) tmp = t_1; elseif (x <= 5e+72) tmp = (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e+26], t$95$1, If[LessEqual[x, 5e+72], N[(N[(y * N[(z * N[(-1.0 + N[(y * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -2 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+72}:\\
\;\;\;\;y \cdot \left(z \cdot \left(-1 + y \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.0000000000000001e26 or 4.99999999999999992e72 < x Initial program 93.3%
Taylor expanded in x around inf
*-lowering-*.f64N/A
log-lowering-log.f6476.6%
Simplified76.6%
if -2.0000000000000001e26 < x < 4.99999999999999992e72Initial program 75.1%
Taylor expanded in y around 0
*-commutativeN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified99.7%
Taylor expanded in x around 0
--lowering--.f64N/A
Simplified78.8%
(FPCore (x y z t) :precision binary64 (- (- (* x (log y)) (* y z)) t))
double code(double x, double y, double z, double t) {
return ((x * log(y)) - (y * z)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * log(y)) - (y * z)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((x * Math.log(y)) - (y * z)) - t;
}
def code(x, y, z, t): return ((x * math.log(y)) - (y * z)) - t
function code(x, y, z, t) return Float64(Float64(Float64(x * log(y)) - Float64(y * z)) - t) end
function tmp = code(x, y, z, t) tmp = ((x * log(y)) - (y * z)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \log y - y \cdot z\right) - t
\end{array}
Initial program 83.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
remove-double-negN/A
log-recN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
--lowering--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
*-commutativeN/A
*-lowering-*.f6499.3%
Simplified99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (if (<= t -4e-45) (- 0.0 t) (if (<= t 6.6e-104) (- 0.0 (* y z)) (- 0.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4e-45) {
tmp = 0.0 - t;
} else if (t <= 6.6e-104) {
tmp = 0.0 - (y * z);
} else {
tmp = 0.0 - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4d-45)) then
tmp = 0.0d0 - t
else if (t <= 6.6d-104) then
tmp = 0.0d0 - (y * z)
else
tmp = 0.0d0 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4e-45) {
tmp = 0.0 - t;
} else if (t <= 6.6e-104) {
tmp = 0.0 - (y * z);
} else {
tmp = 0.0 - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4e-45: tmp = 0.0 - t elif t <= 6.6e-104: tmp = 0.0 - (y * z) else: tmp = 0.0 - t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4e-45) tmp = Float64(0.0 - t); elseif (t <= 6.6e-104) tmp = Float64(0.0 - Float64(y * z)); else tmp = Float64(0.0 - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -4e-45) tmp = 0.0 - t; elseif (t <= 6.6e-104) tmp = 0.0 - (y * z); else tmp = 0.0 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4e-45], N[(0.0 - t), $MachinePrecision], If[LessEqual[t, 6.6e-104], N[(0.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(0.0 - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-45}:\\
\;\;\;\;0 - t\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{-104}:\\
\;\;\;\;0 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;0 - t\\
\end{array}
\end{array}
if t < -3.99999999999999994e-45 or 6.60000000000000004e-104 < t Initial program 92.1%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6459.6%
Simplified59.6%
sub0-negN/A
neg-lowering-neg.f6459.6%
Applied egg-rr59.6%
if -3.99999999999999994e-45 < t < 6.60000000000000004e-104Initial program 71.6%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
remove-double-negN/A
log-recN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
--lowering--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
*-commutativeN/A
*-lowering-*.f6499.1%
Simplified99.1%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6430.4%
Simplified30.4%
Final simplification46.6%
(FPCore (x y z t) :precision binary64 (- (* y (* z (+ -1.0 (* y (+ -0.5 (* y -0.3333333333333333)))))) t))
double code(double x, double y, double z, double t) {
return (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * (z * ((-1.0d0) + (y * ((-0.5d0) + (y * (-0.3333333333333333d0))))))) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t;
}
def code(x, y, z, t): return (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(z * Float64(-1.0 + Float64(y * Float64(-0.5 + Float64(y * -0.3333333333333333)))))) - t) end
function tmp = code(x, y, z, t) tmp = (y * (z * (-1.0 + (y * (-0.5 + (y * -0.3333333333333333)))))) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(z * N[(-1.0 + N[(y * N[(-0.5 + N[(y * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(z \cdot \left(-1 + y \cdot \left(-0.5 + y \cdot -0.3333333333333333\right)\right)\right) - t
\end{array}
Initial program 83.0%
Taylor expanded in y around 0
*-commutativeN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified99.7%
Taylor expanded in x around 0
--lowering--.f64N/A
Simplified54.7%
(FPCore (x y z t) :precision binary64 (- (- 0.0 (* y z)) t))
double code(double x, double y, double z, double t) {
return (0.0 - (y * z)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (0.0d0 - (y * z)) - t
end function
public static double code(double x, double y, double z, double t) {
return (0.0 - (y * z)) - t;
}
def code(x, y, z, t): return (0.0 - (y * z)) - t
function code(x, y, z, t) return Float64(Float64(0.0 - Float64(y * z)) - t) end
function tmp = code(x, y, z, t) tmp = (0.0 - (y * z)) - t; end
code[x_, y_, z_, t_] := N[(N[(0.0 - N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(0 - y \cdot z\right) - t
\end{array}
Initial program 83.0%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
remove-double-negN/A
log-recN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
--lowering--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
*-commutativeN/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
sub-negN/A
--lowering--.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6454.4%
Simplified54.4%
(FPCore (x y z t) :precision binary64 (- 0.0 t))
double code(double x, double y, double z, double t) {
return 0.0 - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 0.0d0 - t
end function
public static double code(double x, double y, double z, double t) {
return 0.0 - t;
}
def code(x, y, z, t): return 0.0 - t
function code(x, y, z, t) return Float64(0.0 - t) end
function tmp = code(x, y, z, t) tmp = 0.0 - t; end
code[x_, y_, z_, t_] := N[(0.0 - t), $MachinePrecision]
\begin{array}{l}
\\
0 - t
\end{array}
Initial program 83.0%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6437.6%
Simplified37.6%
sub0-negN/A
neg-lowering-neg.f6437.6%
Applied egg-rr37.6%
Final simplification37.6%
(FPCore (x y z t)
:precision binary64
(-
(*
(- z)
(+
(+ (* 0.5 (* y y)) y)
(* (/ 0.3333333333333333 (* 1.0 (* 1.0 1.0))) (* y (* y y)))))
(- t (* x (log y)))))
double code(double x, double y, double z, double t) {
return (-z * (((0.5 * (y * y)) + y) + ((0.3333333333333333 / (1.0 * (1.0 * 1.0))) * (y * (y * y))))) - (t - (x * log(y)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (-z * (((0.5d0 * (y * y)) + y) + ((0.3333333333333333d0 / (1.0d0 * (1.0d0 * 1.0d0))) * (y * (y * y))))) - (t - (x * log(y)))
end function
public static double code(double x, double y, double z, double t) {
return (-z * (((0.5 * (y * y)) + y) + ((0.3333333333333333 / (1.0 * (1.0 * 1.0))) * (y * (y * y))))) - (t - (x * Math.log(y)));
}
def code(x, y, z, t): return (-z * (((0.5 * (y * y)) + y) + ((0.3333333333333333 / (1.0 * (1.0 * 1.0))) * (y * (y * y))))) - (t - (x * math.log(y)))
function code(x, y, z, t) return Float64(Float64(Float64(-z) * Float64(Float64(Float64(0.5 * Float64(y * y)) + y) + Float64(Float64(0.3333333333333333 / Float64(1.0 * Float64(1.0 * 1.0))) * Float64(y * Float64(y * y))))) - Float64(t - Float64(x * log(y)))) end
function tmp = code(x, y, z, t) tmp = (-z * (((0.5 * (y * y)) + y) + ((0.3333333333333333 / (1.0 * (1.0 * 1.0))) * (y * (y * y))))) - (t - (x * log(y))); end
code[x_, y_, z_, t_] := N[(N[((-z) * N[(N[(N[(0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + N[(N[(0.3333333333333333 / N[(1.0 * N[(1.0 * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t - N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{0.3333333333333333}{1 \cdot \left(1 \cdot 1\right)} \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) - \left(t - x \cdot \log y\right)
\end{array}
herbie shell --seed 2024152
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
:precision binary64
:alt
(! :herbie-platform default (- (* (- z) (+ (+ (* 1/2 (* y y)) y) (* (/ 1/3 (* 1 (* 1 1))) (* y (* y y))))) (- t (* x (log y)))))
(- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))