
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * 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 = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * 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 = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))) 2e+277) (- (fma (/ y z) -0.3333333333333333 x) (/ t (* (* y z) -3.0))) (fma (/ 0.3333333333333333 z) (- (/ t y) y) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+277) {
tmp = fma((y / z), -0.3333333333333333, x) - (t / ((y * z) * -3.0));
} else {
tmp = fma((0.3333333333333333 / z), ((t / y) - y), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) <= 2e+277) tmp = Float64(fma(Float64(y / z), -0.3333333333333333, x) - Float64(t / Float64(Float64(y * z) * -3.0))); else tmp = fma(Float64(0.3333333333333333 / z), Float64(Float64(t / y) - y), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+277], N[(N[(N[(y / z), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision] - N[(t / N[(N[(y * z), $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 2 \cdot 10^{+277}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -0.3333333333333333, x\right) - \frac{t}{\left(y \cdot z\right) \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y} - y, x\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) < 2.00000000000000001e277Initial program 98.7%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
Applied rewrites98.7%
if 2.00000000000000001e277 < (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) Initial program 86.8%
Taylor expanded in x around 0
associate--l+N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
times-fracN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-out--N/A
lower-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (<= (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))) 5e+303) (fma (/ t (* y z)) 0.3333333333333333 (fma (/ y z) -0.3333333333333333 x)) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 5e+303) {
tmp = fma((t / (y * z)), 0.3333333333333333, fma((y / z), -0.3333333333333333, x));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) <= 5e+303) tmp = fma(Float64(t / Float64(y * z)), 0.3333333333333333, fma(Float64(y / z), -0.3333333333333333, x)); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+303], N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + N[(N[(y / z), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 5 \cdot 10^{+303}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y \cdot z}, 0.3333333333333333, \mathsf{fma}\left(\frac{y}{z}, -0.3333333333333333, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) < 4.9999999999999997e303Initial program 98.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
*-rgt-identityN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
metadata-eval98.7
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites98.7%
if 4.9999999999999997e303 < (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) Initial program 84.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
Final simplification98.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.1e+49)
(fma (* y -0.3333333333333333) (/ 1.0 z) x)
(if (<= y -1.15e-23)
(* (/ 0.3333333333333333 z) (- (/ t y) y))
(if (<= y 1.35e+56)
(fma (/ t z) (/ 0.3333333333333333 y) x)
(fma y (/ -0.3333333333333333 z) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.1e+49) {
tmp = fma((y * -0.3333333333333333), (1.0 / z), x);
} else if (y <= -1.15e-23) {
tmp = (0.3333333333333333 / z) * ((t / y) - y);
} else if (y <= 1.35e+56) {
tmp = fma((t / z), (0.3333333333333333 / y), x);
} else {
tmp = fma(y, (-0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -3.1e+49) tmp = fma(Float64(y * -0.3333333333333333), Float64(1.0 / z), x); elseif (y <= -1.15e-23) tmp = Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y)); elseif (y <= 1.35e+56) tmp = fma(Float64(t / z), Float64(0.3333333333333333 / y), x); else tmp = fma(y, Float64(-0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.1e+49], N[(N[(y * -0.3333333333333333), $MachinePrecision] * N[(1.0 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, -1.15e-23], N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+56], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot -0.3333333333333333, \frac{1}{z}, x\right)\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-23}:\\
\;\;\;\;\frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if y < -3.09999999999999992e49Initial program 99.7%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
Applied rewrites99.6%
Applied rewrites99.6%
Taylor expanded in t around 0
lower-*.f6499.6
Applied rewrites99.6%
if -3.09999999999999992e49 < y < -1.15000000000000005e-23Initial program 99.5%
Taylor expanded in x around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-out--N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6494.1
Applied rewrites94.1%
if -1.15000000000000005e-23 < y < 1.35000000000000005e56Initial program 92.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
Applied rewrites92.8%
Taylor expanded in y around 0
div-subN/A
*-commutativeN/A
associate-/l*N/A
associate-/l*N/A
associate-/l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6488.7
Applied rewrites88.7%
Applied rewrites94.8%
if 1.35000000000000005e56 < y Initial program 99.8%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
Applied rewrites97.9%
Final simplification96.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ (- (/ t y) y) (* z 3.0)))))
(if (<= y -2.3e-63)
t_1
(if (<= y 3.4e-37) (fma (/ t z) (/ 0.3333333333333333 y) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (((t / y) - y) / (z * 3.0));
double tmp;
if (y <= -2.3e-63) {
tmp = t_1;
} else if (y <= 3.4e-37) {
tmp = fma((t / z), (0.3333333333333333 / y), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))) tmp = 0.0 if (y <= -2.3e-63) tmp = t_1; elseif (y <= 3.4e-37) tmp = fma(Float64(t / z), Float64(0.3333333333333333 / y), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.3e-63], t$95$1, If[LessEqual[y, 3.4e-37], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-37}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.3e-63 or 3.40000000000000018e-37 < y Initial program 99.7%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
if -2.3e-63 < y < 3.40000000000000018e-37Initial program 91.1%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
Applied rewrites91.1%
Taylor expanded in y around 0
div-subN/A
*-commutativeN/A
associate-/l*N/A
associate-/l*N/A
associate-/l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6489.5
Applied rewrites89.5%
Applied rewrites97.1%
Final simplification98.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma (/ 0.3333333333333333 z) (- (/ t y) y) x)))
(if (<= y -2.3e-63)
t_1
(if (<= y 3.4e-37) (fma (/ t z) (/ 0.3333333333333333 y) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma((0.3333333333333333 / z), ((t / y) - y), x);
double tmp;
if (y <= -2.3e-63) {
tmp = t_1;
} else if (y <= 3.4e-37) {
tmp = fma((t / z), (0.3333333333333333 / y), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(Float64(0.3333333333333333 / z), Float64(Float64(t / y) - y), x) tmp = 0.0 if (y <= -2.3e-63) tmp = t_1; elseif (y <= 3.4e-37) tmp = fma(Float64(t / z), Float64(0.3333333333333333 / y), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -2.3e-63], t$95$1, If[LessEqual[y, 3.4e-37], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y} - y, x\right)\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-37}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.3e-63 or 3.40000000000000018e-37 < y Initial program 99.7%
Taylor expanded in x around 0
associate--l+N/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
times-fracN/A
metadata-evalN/A
associate-*r/N/A
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-out--N/A
lower-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
if -2.3e-63 < y < 3.40000000000000018e-37Initial program 91.1%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
Applied rewrites91.1%
Taylor expanded in y around 0
div-subN/A
*-commutativeN/A
associate-/l*N/A
associate-/l*N/A
associate-/l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6489.5
Applied rewrites89.5%
Applied rewrites97.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.4e-23)
(fma (* y -0.3333333333333333) (/ 1.0 z) x)
(if (<= y 1.35e+56)
(fma (/ t z) (/ 0.3333333333333333 y) x)
(fma y (/ -0.3333333333333333 z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.4e-23) {
tmp = fma((y * -0.3333333333333333), (1.0 / z), x);
} else if (y <= 1.35e+56) {
tmp = fma((t / z), (0.3333333333333333 / y), x);
} else {
tmp = fma(y, (-0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -3.4e-23) tmp = fma(Float64(y * -0.3333333333333333), Float64(1.0 / z), x); elseif (y <= 1.35e+56) tmp = fma(Float64(t / z), Float64(0.3333333333333333 / y), x); else tmp = fma(y, Float64(-0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.4e-23], N[(N[(y * -0.3333333333333333), $MachinePrecision] * N[(1.0 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 1.35e+56], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot -0.3333333333333333, \frac{1}{z}, x\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if y < -3.4000000000000001e-23Initial program 99.6%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
Applied rewrites99.7%
Applied rewrites99.6%
Taylor expanded in t around 0
lower-*.f6489.8
Applied rewrites89.8%
if -3.4000000000000001e-23 < y < 1.35000000000000005e56Initial program 92.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
Applied rewrites92.8%
Taylor expanded in y around 0
div-subN/A
*-commutativeN/A
associate-/l*N/A
associate-/l*N/A
associate-/l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6488.7
Applied rewrites88.7%
Applied rewrites94.8%
if 1.35000000000000005e56 < y Initial program 99.8%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
Applied rewrites97.9%
Final simplification94.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.4e-23)
(fma (* y -0.3333333333333333) (/ 1.0 z) x)
(if (<= y 1.35e+56)
(fma 0.3333333333333333 (/ t (* y z)) x)
(fma y (/ -0.3333333333333333 z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.4e-23) {
tmp = fma((y * -0.3333333333333333), (1.0 / z), x);
} else if (y <= 1.35e+56) {
tmp = fma(0.3333333333333333, (t / (y * z)), x);
} else {
tmp = fma(y, (-0.3333333333333333 / z), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -3.4e-23) tmp = fma(Float64(y * -0.3333333333333333), Float64(1.0 / z), x); elseif (y <= 1.35e+56) tmp = fma(0.3333333333333333, Float64(t / Float64(y * z)), x); else tmp = fma(y, Float64(-0.3333333333333333 / z), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.4e-23], N[(N[(y * -0.3333333333333333), $MachinePrecision] * N[(1.0 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 1.35e+56], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot -0.3333333333333333, \frac{1}{z}, x\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \frac{t}{y \cdot z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\end{array}
\end{array}
if y < -3.4000000000000001e-23Initial program 99.6%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
Applied rewrites99.7%
Applied rewrites99.6%
Taylor expanded in t around 0
lower-*.f6489.8
Applied rewrites89.8%
if -3.4000000000000001e-23 < y < 1.35000000000000005e56Initial program 92.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
Applied rewrites92.8%
Taylor expanded in y around 0
div-subN/A
*-commutativeN/A
associate-/l*N/A
associate-/l*N/A
associate-/l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6488.7
Applied rewrites88.7%
if 1.35000000000000005e56 < y Initial program 99.8%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
Applied rewrites97.9%
Final simplification90.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma y (/ -0.3333333333333333 z) x)))
(if (<= y -3.4e-23)
t_1
(if (<= y 1.35e+56) (fma 0.3333333333333333 (/ t (* y z)) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(y, (-0.3333333333333333 / z), x);
double tmp;
if (y <= -3.4e-23) {
tmp = t_1;
} else if (y <= 1.35e+56) {
tmp = fma(0.3333333333333333, (t / (y * z)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(y, Float64(-0.3333333333333333 / z), x) tmp = 0.0 if (y <= -3.4e-23) tmp = t_1; elseif (y <= 1.35e+56) tmp = fma(0.3333333333333333, Float64(t / Float64(y * z)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -3.4e-23], t$95$1, If[LessEqual[y, 1.35e+56], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \frac{t}{y \cdot z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.4000000000000001e-23 or 1.35000000000000005e56 < y Initial program 99.7%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
Applied rewrites93.3%
if -3.4000000000000001e-23 < y < 1.35000000000000005e56Initial program 92.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
Applied rewrites92.8%
Taylor expanded in y around 0
div-subN/A
*-commutativeN/A
associate-/l*N/A
associate-/l*N/A
associate-/l/N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f6488.7
Applied rewrites88.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma y (/ -0.3333333333333333 z) x)))
(if (<= y -1.85e-53)
t_1
(if (<= y 1.65e-30) (/ (* t 0.3333333333333333) (* y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(y, (-0.3333333333333333 / z), x);
double tmp;
if (y <= -1.85e-53) {
tmp = t_1;
} else if (y <= 1.65e-30) {
tmp = (t * 0.3333333333333333) / (y * z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(y, Float64(-0.3333333333333333 / z), x) tmp = 0.0 if (y <= -1.85e-53) tmp = t_1; elseif (y <= 1.65e-30) tmp = Float64(Float64(t * 0.3333333333333333) / Float64(y * z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -1.85e-53], t$95$1, If[LessEqual[y, 1.65e-30], N[(N[(t * 0.3333333333333333), $MachinePrecision] / N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-30}:\\
\;\;\;\;\frac{t \cdot 0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.84999999999999991e-53 or 1.6500000000000001e-30 < y Initial program 99.7%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
Applied rewrites88.9%
if -1.84999999999999991e-53 < y < 1.6500000000000001e-30Initial program 91.5%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6471.4
Applied rewrites71.4%
Final simplification81.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma y (/ -0.3333333333333333 z) x))) (if (<= y -1.85e-53) t_1 (if (<= y 1.65e-30) (/ t (* 3.0 (* y z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(y, (-0.3333333333333333 / z), x);
double tmp;
if (y <= -1.85e-53) {
tmp = t_1;
} else if (y <= 1.65e-30) {
tmp = t / (3.0 * (y * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(y, Float64(-0.3333333333333333 / z), x) tmp = 0.0 if (y <= -1.85e-53) tmp = t_1; elseif (y <= 1.65e-30) tmp = Float64(t / Float64(3.0 * Float64(y * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -1.85e-53], t$95$1, If[LessEqual[y, 1.65e-30], N[(t / N[(3.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-30}:\\
\;\;\;\;\frac{t}{3 \cdot \left(y \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.84999999999999991e-53 or 1.6500000000000001e-30 < y Initial program 99.7%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
Applied rewrites88.9%
if -1.84999999999999991e-53 < y < 1.6500000000000001e-30Initial program 91.5%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6471.4
Applied rewrites71.4%
Applied rewrites71.3%
Applied rewrites71.4%
Final simplification81.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma y (/ -0.3333333333333333 z) x))) (if (<= y -1.85e-53) t_1 (if (<= y 1.65e-30) (/ t (* y (* z 3.0))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(y, (-0.3333333333333333 / z), x);
double tmp;
if (y <= -1.85e-53) {
tmp = t_1;
} else if (y <= 1.65e-30) {
tmp = t / (y * (z * 3.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(y, Float64(-0.3333333333333333 / z), x) tmp = 0.0 if (y <= -1.85e-53) tmp = t_1; elseif (y <= 1.65e-30) tmp = Float64(t / Float64(y * Float64(z * 3.0))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -1.85e-53], t$95$1, If[LessEqual[y, 1.65e-30], N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-30}:\\
\;\;\;\;\frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.84999999999999991e-53 or 1.6500000000000001e-30 < y Initial program 99.7%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
Applied rewrites88.9%
if -1.84999999999999991e-53 < y < 1.6500000000000001e-30Initial program 91.5%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6471.4
Applied rewrites71.4%
Applied rewrites71.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma y (/ -0.3333333333333333 z) x)))
(if (<= y -1.85e-53)
t_1
(if (<= y 1.65e-30) (* 0.3333333333333333 (/ t (* y z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(y, (-0.3333333333333333 / z), x);
double tmp;
if (y <= -1.85e-53) {
tmp = t_1;
} else if (y <= 1.65e-30) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(y, Float64(-0.3333333333333333 / z), x) tmp = 0.0 if (y <= -1.85e-53) tmp = t_1; elseif (y <= 1.65e-30) tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -1.85e-53], t$95$1, If[LessEqual[y, 1.65e-30], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-30}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.84999999999999991e-53 or 1.6500000000000001e-30 < y Initial program 99.7%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
Applied rewrites88.9%
if -1.84999999999999991e-53 < y < 1.6500000000000001e-30Initial program 91.5%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6471.4
Applied rewrites71.4%
Applied rewrites71.3%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma y (/ -0.3333333333333333 z) x)))
(if (<= y -1.85e-53)
t_1
(if (<= y 1.6e-30) (* t (/ 0.3333333333333333 (* y z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(y, (-0.3333333333333333 / z), x);
double tmp;
if (y <= -1.85e-53) {
tmp = t_1;
} else if (y <= 1.6e-30) {
tmp = t * (0.3333333333333333 / (y * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(y, Float64(-0.3333333333333333 / z), x) tmp = 0.0 if (y <= -1.85e-53) tmp = t_1; elseif (y <= 1.6e-30) tmp = Float64(t * Float64(0.3333333333333333 / Float64(y * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -1.85e-53], t$95$1, If[LessEqual[y, 1.6e-30], N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-30}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.84999999999999991e-53 or 1.6e-30 < y Initial program 99.7%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
Applied rewrites88.9%
if -1.84999999999999991e-53 < y < 1.6e-30Initial program 91.5%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6471.4
Applied rewrites71.4%
Applied rewrites71.3%
(FPCore (x y z t) :precision binary64 (fma y (/ -0.3333333333333333 z) x))
double code(double x, double y, double z, double t) {
return fma(y, (-0.3333333333333333 / z), x);
}
function code(x, y, z, t) return fma(y, Float64(-0.3333333333333333 / z), x) end
code[x_, y_, z_, t_] := N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)
\end{array}
Initial program 96.0%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
cancel-sign-subN/A
mul-1-negN/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
mul-1-negN/A
*-inversesN/A
cancel-sign-subN/A
*-rgt-identityN/A
Applied rewrites59.4%
(FPCore (x y z t) :precision binary64 (/ (* y -0.3333333333333333) z))
double code(double x, double y, double z, double t) {
return (y * -0.3333333333333333) / z;
}
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 * (-0.3333333333333333d0)) / z
end function
public static double code(double x, double y, double z, double t) {
return (y * -0.3333333333333333) / z;
}
def code(x, y, z, t): return (y * -0.3333333333333333) / z
function code(x, y, z, t) return Float64(Float64(y * -0.3333333333333333) / z) end
function tmp = code(x, y, z, t) tmp = (y * -0.3333333333333333) / z; end
code[x_, y_, z_, t_] := N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{y \cdot -0.3333333333333333}{z}
\end{array}
Initial program 96.0%
Taylor expanded in y around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6435.9
Applied rewrites35.9%
Applied rewrites35.9%
(FPCore (x y z t) :precision binary64 (* (/ y z) -0.3333333333333333))
double code(double x, double y, double z, double t) {
return (y / z) * -0.3333333333333333;
}
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) * (-0.3333333333333333d0)
end function
public static double code(double x, double y, double z, double t) {
return (y / z) * -0.3333333333333333;
}
def code(x, y, z, t): return (y / z) * -0.3333333333333333
function code(x, y, z, t) return Float64(Float64(y / z) * -0.3333333333333333) end
function tmp = code(x, y, z, t) tmp = (y / z) * -0.3333333333333333; end
code[x_, y_, z_, t_] := N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{z} \cdot -0.3333333333333333
\end{array}
Initial program 96.0%
Taylor expanded in y around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6435.9
Applied rewrites35.9%
Applied rewrites35.9%
(FPCore (x y z t) :precision binary64 (* y (/ -0.3333333333333333 z)))
double code(double x, double y, double z, double t) {
return y * (-0.3333333333333333 / z);
}
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 * ((-0.3333333333333333d0) / z)
end function
public static double code(double x, double y, double z, double t) {
return y * (-0.3333333333333333 / z);
}
def code(x, y, z, t): return y * (-0.3333333333333333 / z)
function code(x, y, z, t) return Float64(y * Float64(-0.3333333333333333 / z)) end
function tmp = code(x, y, z, t) tmp = y * (-0.3333333333333333 / z); end
code[x_, y_, z_, t_] := N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 96.0%
Taylor expanded in y around inf
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
associate-*r/N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6435.9
Applied rewrites35.9%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / 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 = (x - (y / (z * 3.0d0))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(Float64(t / Float64(z * 3.0)) / y)) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
herbie shell --seed 2024226
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))