
(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 12 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 (fma (/ -1.0 z) (* y 0.3333333333333333) (+ x (/ t (* y (* z 3.0))))))
double code(double x, double y, double z, double t) {
return fma((-1.0 / z), (y * 0.3333333333333333), (x + (t / (y * (z * 3.0)))));
}
function code(x, y, z, t) return fma(Float64(-1.0 / z), Float64(y * 0.3333333333333333), Float64(x + Float64(t / Float64(y * Float64(z * 3.0))))) end
code[x_, y_, z_, t_] := N[(N[(-1.0 / z), $MachinePrecision] * N[(y * 0.3333333333333333), $MachinePrecision] + N[(x + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{-1}{z}, y \cdot 0.3333333333333333, x + \frac{t}{y \cdot \left(z \cdot 3\right)}\right)
\end{array}
Initial program 97.8%
lift-*.f64N/A
lift-/.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-/.f64N/A
distribute-neg-fracN/A
neg-mul-1N/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower-+.f6498.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.2
Applied egg-rr98.2%
(FPCore (x y z t) :precision binary64 (- (fma y (/ -0.3333333333333333 z) x) (/ t (* (* z y) -3.0))))
double code(double x, double y, double z, double t) {
return fma(y, (-0.3333333333333333 / z), x) - (t / ((z * y) * -3.0));
}
function code(x, y, z, t) return Float64(fma(y, Float64(-0.3333333333333333 / z), x) - Float64(t / Float64(Float64(z * y) * -3.0))) end
code[x_, y_, z_, t_] := N[(N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision] - N[(t / N[(N[(z * y), $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right) - \frac{t}{\left(z \cdot y\right) \cdot -3}
\end{array}
Initial program 97.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
Applied egg-rr97.8%
Final simplification97.8%
(FPCore (x y z t) :precision binary64 (- (fma y (/ -0.3333333333333333 z) x) (/ t (* z (* y -3.0)))))
double code(double x, double y, double z, double t) {
return fma(y, (-0.3333333333333333 / z), x) - (t / (z * (y * -3.0)));
}
function code(x, y, z, t) return Float64(fma(y, Float64(-0.3333333333333333 / z), x) - Float64(t / Float64(z * Float64(y * -3.0)))) end
code[x_, y_, z_, t_] := N[(N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision] - N[(t / N[(z * N[(y * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right) - \frac{t}{z \cdot \left(y \cdot -3\right)}
\end{array}
Initial program 97.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
sub-negN/A
associate--r+N/A
lift--.f64N/A
lower--.f64N/A
Applied egg-rr97.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6497.8
Applied egg-rr97.8%
Final simplification97.8%
(FPCore (x y z t) :precision binary64 (fma (/ t (* z y)) 0.3333333333333333 (fma y (/ -0.3333333333333333 z) x)))
double code(double x, double y, double z, double t) {
return fma((t / (z * y)), 0.3333333333333333, fma(y, (-0.3333333333333333 / z), x));
}
function code(x, y, z, t) return fma(Float64(t / Float64(z * y)), 0.3333333333333333, fma(y, Float64(-0.3333333333333333 / z), x)) end
code[x_, y_, z_, t_] := N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\right)
\end{array}
Initial program 97.8%
lift-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
metadata-eval97.8
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied egg-rr97.8%
Final simplification97.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma y (/ -0.3333333333333333 z) x)))
(if (<= y -1.6e-31)
t_1
(if (<= y 3.5e-40) (fma 0.3333333333333333 (/ t (* z y)) 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 <= -1.6e-31) {
tmp = t_1;
} else if (y <= 3.5e-40) {
tmp = fma(0.3333333333333333, (t / (z * y)), 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 <= -1.6e-31) tmp = t_1; elseif (y <= 3.5e-40) tmp = fma(0.3333333333333333, Float64(t / Float64(z * y)), 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, -1.6e-31], t$95$1, If[LessEqual[y, 3.5e-40], N[(0.3333333333333333 * N[(t / N[(z * y), $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 -1.6 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-40}:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \frac{t}{z \cdot y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.60000000000000009e-31 or 3.5000000000000002e-40 < y Initial program 99.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
Simplified92.8%
if -1.60000000000000009e-31 < y < 3.5000000000000002e-40Initial program 96.3%
lift-*.f64N/A
lift-/.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-/.f64N/A
distribute-neg-fracN/A
neg-mul-1N/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower-+.f6496.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6496.3
Applied egg-rr96.3%
Taylor expanded in y around 0
+-commutativeN/A
metadata-evalN/A
cancel-sign-sub-invN/A
div-subN/A
associate-*l/N/A
remove-double-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
associate-/l*N/A
associate-/l/N/A
cancel-sign-sub-invN/A
neg-sub0N/A
associate-*r/N/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
metadata-evalN/A
associate-+l-N/A
Simplified95.0%
Final simplification93.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma y (/ -0.3333333333333333 z) x)))
(if (<= y -1.5e-34)
t_1
(if (<= y 8.5e-50) (* 0.3333333333333333 (/ t (* z y))) 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.5e-34) {
tmp = t_1;
} else if (y <= 8.5e-50) {
tmp = 0.3333333333333333 * (t / (z * y));
} 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.5e-34) tmp = t_1; elseif (y <= 8.5e-50) tmp = Float64(0.3333333333333333 * Float64(t / Float64(z * y))); 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.5e-34], t$95$1, If[LessEqual[y, 8.5e-50], N[(0.3333333333333333 * N[(t / N[(z * y), $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.5 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-50}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.5e-34 or 8.50000000000000012e-50 < y Initial program 99.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
Simplified92.8%
if -1.5e-34 < y < 8.50000000000000012e-50Initial program 96.3%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6469.5
Simplified69.5%
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lift-*.f64N/A
lower-/.f6469.6
Applied egg-rr69.6%
Final simplification82.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma y (/ -0.3333333333333333 z) x)))
(if (<= y -9.2e-38)
t_1
(if (<= y 5.8e-45) (* t (/ 0.3333333333333333 (* z y))) 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 <= -9.2e-38) {
tmp = t_1;
} else if (y <= 5.8e-45) {
tmp = t * (0.3333333333333333 / (z * y));
} 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 <= -9.2e-38) tmp = t_1; elseif (y <= 5.8e-45) tmp = Float64(t * Float64(0.3333333333333333 / Float64(z * y))); 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, -9.2e-38], t$95$1, If[LessEqual[y, 5.8e-45], N[(t * N[(0.3333333333333333 / N[(z * y), $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 -9.2 \cdot 10^{-38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-45}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.20000000000000007e-38 or 5.8e-45 < y Initial program 99.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
Simplified92.8%
if -9.20000000000000007e-38 < y < 5.8e-45Initial program 96.3%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6469.5
Simplified69.5%
*-commutativeN/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6469.0
Applied egg-rr69.0%
Final simplification82.4%
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
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 + (((t / y) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
def code(x, y, z, t): return x + (((t / y) - y) / (z * 3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Initial program 97.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
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-/.f6496.1
Applied egg-rr96.1%
Final simplification96.1%
(FPCore (x y z t) :precision binary64 (fma (/ 0.3333333333333333 z) (- (/ t y) y) x))
double code(double x, double y, double z, double t) {
return fma((0.3333333333333333 / z), ((t / y) - y), x);
}
function code(x, y, z, t) return fma(Float64(0.3333333333333333 / z), Float64(Float64(t / y) - y), x) end
code[x_, y_, z_, t_] := N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y} - y, x\right)
\end{array}
Initial program 97.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-/.f6496.1
Simplified96.1%
(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 97.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
Simplified64.4%
(FPCore (x y z t) :precision binary64 (/ y (* z -3.0)))
double code(double x, double y, double z, double t) {
return y / (z * -3.0);
}
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 * (-3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return y / (z * -3.0);
}
def code(x, y, z, t): return y / (z * -3.0)
function code(x, y, z, t) return Float64(y / Float64(z * -3.0)) end
function tmp = code(x, y, z, t) tmp = y / (z * -3.0); end
code[x_, y_, z_, t_] := N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{z \cdot -3}
\end{array}
Initial program 97.8%
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-/.f6438.6
Simplified38.6%
clear-numN/A
un-div-invN/A
lower-/.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6438.6
Applied egg-rr38.6%
(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 97.8%
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-/.f6438.6
Simplified38.6%
(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 2024207
(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))))