
(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 11 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
(let* ((t_1 (/ y (* z 3.0))))
(if (<= (+ (- x t_1) (/ t (* y (* z 3.0)))) 1e+297)
(- x (- t_1 (/ t (* z (* y 3.0)))))
(- x (* (- y (/ t y)) (/ -1.0 (/ z -0.3333333333333333)))))))
double code(double x, double y, double z, double t) {
double t_1 = y / (z * 3.0);
double tmp;
if (((x - t_1) + (t / (y * (z * 3.0)))) <= 1e+297) {
tmp = x - (t_1 - (t / (z * (y * 3.0))));
} else {
tmp = x - ((y - (t / y)) * (-1.0 / (z / -0.3333333333333333)));
}
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 = y / (z * 3.0d0)
if (((x - t_1) + (t / (y * (z * 3.0d0)))) <= 1d+297) then
tmp = x - (t_1 - (t / (z * (y * 3.0d0))))
else
tmp = x - ((y - (t / y)) * ((-1.0d0) / (z / (-0.3333333333333333d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y / (z * 3.0);
double tmp;
if (((x - t_1) + (t / (y * (z * 3.0)))) <= 1e+297) {
tmp = x - (t_1 - (t / (z * (y * 3.0))));
} else {
tmp = x - ((y - (t / y)) * (-1.0 / (z / -0.3333333333333333)));
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (z * 3.0) tmp = 0 if ((x - t_1) + (t / (y * (z * 3.0)))) <= 1e+297: tmp = x - (t_1 - (t / (z * (y * 3.0)))) else: tmp = x - ((y - (t / y)) * (-1.0 / (z / -0.3333333333333333))) return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(z * 3.0)) tmp = 0.0 if (Float64(Float64(x - t_1) + Float64(t / Float64(y * Float64(z * 3.0)))) <= 1e+297) tmp = Float64(x - Float64(t_1 - Float64(t / Float64(z * Float64(y * 3.0))))); else tmp = Float64(x - Float64(Float64(y - Float64(t / y)) * Float64(-1.0 / Float64(z / -0.3333333333333333)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (z * 3.0); tmp = 0.0; if (((x - t_1) + (t / (y * (z * 3.0)))) <= 1e+297) tmp = x - (t_1 - (t / (z * (y * 3.0)))); else tmp = x - ((y - (t / y)) * (-1.0 / (z / -0.3333333333333333))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x - t$95$1), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+297], N[(x - N[(t$95$1 - N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(z / -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z \cdot 3}\\
\mathbf{if}\;\left(x - t_1\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 10^{+297}:\\
\;\;\;\;x - \left(t_1 - \frac{t}{z \cdot \left(y \cdot 3\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \left(y - \frac{t}{y}\right) \cdot \frac{-1}{\frac{z}{-0.3333333333333333}}\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) < 1e297Initial program 98.5%
associate-+l-98.5%
associate-/r*94.4%
associate-/r*98.5%
associate-*l*98.5%
Applied egg-rr98.5%
if 1e297 < (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) Initial program 73.4%
associate-+l-73.4%
sub-neg73.4%
sub-neg73.4%
distribute-neg-in73.4%
unsub-neg73.4%
neg-mul-173.4%
associate-*r/73.4%
associate-*l/73.4%
distribute-neg-frac73.4%
neg-mul-173.4%
times-frac94.4%
distribute-lft-out--100.0%
*-commutative100.0%
associate-/r*99.9%
metadata-eval99.9%
Simplified99.9%
clear-num100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0))))))
(if (<= t_1 1e+297)
t_1
(- x (* (- y (/ t y)) (/ -1.0 (/ z -0.3333333333333333)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
double tmp;
if (t_1 <= 1e+297) {
tmp = t_1;
} else {
tmp = x - ((y - (t / y)) * (-1.0 / (z / -0.3333333333333333)));
}
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 - (y / (z * 3.0d0))) + (t / (y * (z * 3.0d0)))
if (t_1 <= 1d+297) then
tmp = t_1
else
tmp = x - ((y - (t / y)) * ((-1.0d0) / (z / (-0.3333333333333333d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
double tmp;
if (t_1 <= 1e+297) {
tmp = t_1;
} else {
tmp = x - ((y - (t / y)) * (-1.0 / (z / -0.3333333333333333)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))) tmp = 0 if t_1 <= 1e+297: tmp = t_1 else: tmp = x - ((y - (t / y)) * (-1.0 / (z / -0.3333333333333333))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) tmp = 0.0 if (t_1 <= 1e+297) tmp = t_1; else tmp = Float64(x - Float64(Float64(y - Float64(t / y)) * Float64(-1.0 / Float64(z / -0.3333333333333333)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))); tmp = 0.0; if (t_1 <= 1e+297) tmp = t_1; else tmp = x - ((y - (t / y)) * (-1.0 / (z / -0.3333333333333333))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+297], t$95$1, N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(z / -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{if}\;t_1 \leq 10^{+297}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - \left(y - \frac{t}{y}\right) \cdot \frac{-1}{\frac{z}{-0.3333333333333333}}\\
\end{array}
\end{array}
if (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) < 1e297Initial program 98.5%
if 1e297 < (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) Initial program 73.4%
associate-+l-73.4%
sub-neg73.4%
sub-neg73.4%
distribute-neg-in73.4%
unsub-neg73.4%
neg-mul-173.4%
associate-*r/73.4%
associate-*l/73.4%
distribute-neg-frac73.4%
neg-mul-173.4%
times-frac94.4%
distribute-lft-out--100.0%
*-commutative100.0%
associate-/r*99.9%
metadata-eval99.9%
Simplified99.9%
clear-num100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.25e+29)
(- x (/ y (* z 3.0)))
(if (<= y 3.9e-12)
(+ x (* (/ t y) (/ 0.3333333333333333 z)))
(+ x (/ (* y -0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e+29) {
tmp = x - (y / (z * 3.0));
} else if (y <= 3.9e-12) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
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 (y <= (-1.25d+29)) then
tmp = x - (y / (z * 3.0d0))
else if (y <= 3.9d-12) then
tmp = x + ((t / y) * (0.3333333333333333d0 / z))
else
tmp = x + ((y * (-0.3333333333333333d0)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e+29) {
tmp = x - (y / (z * 3.0));
} else if (y <= 3.9e-12) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.25e+29: tmp = x - (y / (z * 3.0)) elif y <= 3.9e-12: tmp = x + ((t / y) * (0.3333333333333333 / z)) else: tmp = x + ((y * -0.3333333333333333) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.25e+29) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 3.9e-12) tmp = Float64(x + Float64(Float64(t / y) * Float64(0.3333333333333333 / z))); else tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.25e+29) tmp = x - (y / (z * 3.0)); elseif (y <= 3.9e-12) tmp = x + ((t / y) * (0.3333333333333333 / z)); else tmp = x + ((y * -0.3333333333333333) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.25e+29], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-12], N[(x + N[(N[(t / y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+29}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-12}:\\
\;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.25e29Initial program 99.8%
Taylor expanded in t around 0 96.4%
metadata-eval96.4%
times-frac96.4%
*-un-lft-identity96.4%
*-commutative96.4%
Applied egg-rr96.4%
if -1.25e29 < y < 3.89999999999999994e-12Initial program 91.5%
associate-+l-91.5%
sub-neg91.5%
sub-neg91.5%
distribute-neg-in91.5%
unsub-neg91.5%
neg-mul-191.5%
associate-*r/91.5%
associate-*l/91.5%
distribute-neg-frac91.5%
neg-mul-191.5%
times-frac93.0%
distribute-lft-out--93.0%
*-commutative93.0%
associate-/r*92.9%
metadata-eval92.9%
Simplified92.9%
Taylor expanded in y around 0 86.0%
*-commutative86.0%
associate-*l/86.1%
times-frac87.0%
Simplified87.0%
if 3.89999999999999994e-12 < y Initial program 97.1%
associate-+l-97.1%
sub-neg97.1%
sub-neg97.1%
distribute-neg-in97.1%
unsub-neg97.1%
neg-mul-197.1%
associate-*r/97.1%
associate-*l/97.0%
distribute-neg-frac97.0%
neg-mul-197.0%
times-frac97.0%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 96.9%
+-commutative96.9%
metadata-eval96.9%
cancel-sign-sub-inv96.9%
associate-/r*96.9%
associate-*r/96.9%
associate-*r/97.1%
div-sub99.8%
distribute-lft-out--99.8%
Simplified99.8%
Taylor expanded in t around 0 95.8%
Final simplification91.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.05e+29)
(- x (/ y (* z 3.0)))
(if (<= y 8.8e-11)
(+ x (* (/ t z) (/ 0.3333333333333333 y)))
(+ x (/ (* y -0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e+29) {
tmp = x - (y / (z * 3.0));
} else if (y <= 8.8e-11) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
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 (y <= (-1.05d+29)) then
tmp = x - (y / (z * 3.0d0))
else if (y <= 8.8d-11) then
tmp = x + ((t / z) * (0.3333333333333333d0 / y))
else
tmp = x + ((y * (-0.3333333333333333d0)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e+29) {
tmp = x - (y / (z * 3.0));
} else if (y <= 8.8e-11) {
tmp = x + ((t / z) * (0.3333333333333333 / y));
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.05e+29: tmp = x - (y / (z * 3.0)) elif y <= 8.8e-11: tmp = x + ((t / z) * (0.3333333333333333 / y)) else: tmp = x + ((y * -0.3333333333333333) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.05e+29) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (y <= 8.8e-11) tmp = Float64(x + Float64(Float64(t / z) * Float64(0.3333333333333333 / y))); else tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.05e+29) tmp = x - (y / (z * 3.0)); elseif (y <= 8.8e-11) tmp = x + ((t / z) * (0.3333333333333333 / y)); else tmp = x + ((y * -0.3333333333333333) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.05e+29], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.8e-11], N[(x + N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+29}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{-11}:\\
\;\;\;\;x + \frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.0500000000000001e29Initial program 99.8%
Taylor expanded in t around 0 96.4%
metadata-eval96.4%
times-frac96.4%
*-un-lft-identity96.4%
*-commutative96.4%
Applied egg-rr96.4%
if -1.0500000000000001e29 < y < 8.8000000000000006e-11Initial program 91.5%
associate-+l-91.5%
sub-neg91.5%
sub-neg91.5%
distribute-neg-in91.5%
unsub-neg91.5%
neg-mul-191.5%
associate-*r/91.5%
associate-*l/91.5%
distribute-neg-frac91.5%
neg-mul-191.5%
times-frac93.0%
distribute-lft-out--93.0%
*-commutative93.0%
associate-/r*92.9%
metadata-eval92.9%
Simplified92.9%
Taylor expanded in y around 0 86.0%
*-commutative86.0%
associate-*l/86.1%
times-frac87.0%
Simplified87.0%
frac-times86.1%
Applied egg-rr86.1%
*-commutative86.1%
times-frac92.3%
Applied egg-rr92.3%
if 8.8000000000000006e-11 < y Initial program 97.1%
associate-+l-97.1%
sub-neg97.1%
sub-neg97.1%
distribute-neg-in97.1%
unsub-neg97.1%
neg-mul-197.1%
associate-*r/97.1%
associate-*l/97.0%
distribute-neg-frac97.0%
neg-mul-197.0%
times-frac97.0%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 96.9%
+-commutative96.9%
metadata-eval96.9%
cancel-sign-sub-inv96.9%
associate-/r*96.9%
associate-*r/96.9%
associate-*r/97.1%
div-sub99.8%
distribute-lft-out--99.8%
Simplified99.8%
Taylor expanded in t around 0 95.8%
Final simplification94.2%
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ 1.0 (/ y t)) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
return x + (((1.0 / (y / t)) - 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 + (((1.0d0 / (y / t)) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x + (((1.0 / (y / t)) - y) / (z * 3.0));
}
def code(x, y, z, t): return x + (((1.0 / (y / t)) - y) / (z * 3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(1.0 / Float64(y / t)) - y) / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x + (((1.0 / (y / t)) - y) / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(1.0 / N[(y / t), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{1}{\frac{y}{t}} - y}{z \cdot 3}
\end{array}
Initial program 95.0%
associate-+l-95.0%
sub-neg95.0%
sub-neg95.0%
distribute-neg-in95.0%
unsub-neg95.0%
neg-mul-195.0%
associate-*r/95.0%
associate-*l/95.0%
distribute-neg-frac95.0%
neg-mul-195.0%
times-frac95.7%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
clear-num96.4%
inv-pow96.4%
Applied egg-rr96.4%
unpow-196.4%
Simplified96.4%
associate-*l/96.5%
*-un-lft-identity96.5%
frac-2neg96.5%
div-inv96.5%
metadata-eval96.5%
Applied egg-rr96.5%
neg-sub096.5%
associate-+l-96.5%
neg-sub096.5%
+-commutative96.5%
sub-neg96.5%
distribute-rgt-neg-in96.5%
metadata-eval96.5%
Simplified96.5%
div-inv96.5%
fma-neg96.5%
Applied egg-rr96.5%
fma-udef96.5%
unsub-neg96.5%
Simplified96.5%
un-div-inv96.5%
clear-num96.5%
Applied egg-rr96.5%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 (+ x (* (- y (/ t y)) (/ -0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + ((y - (t / 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 = x + ((y - (t / y)) * ((-0.3333333333333333d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - (t / y)) * (-0.3333333333333333 / z));
}
def code(x, y, z, t): return x + ((y - (t / y)) * (-0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - Float64(t / y)) * Float64(-0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 95.0%
associate-+l-95.0%
sub-neg95.0%
sub-neg95.0%
distribute-neg-in95.0%
unsub-neg95.0%
neg-mul-195.0%
associate-*r/95.0%
associate-*l/95.0%
distribute-neg-frac95.0%
neg-mul-195.0%
times-frac95.7%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Final simplification96.4%
(FPCore (x y z t) :precision binary64 (- x (/ (* (- y (/ t y)) 0.3333333333333333) z)))
double code(double x, double y, double z, double t) {
return x - (((y - (t / 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 = x - (((y - (t / y)) * 0.3333333333333333d0) / z)
end function
public static double code(double x, double y, double z, double t) {
return x - (((y - (t / y)) * 0.3333333333333333) / z);
}
def code(x, y, z, t): return x - (((y - (t / y)) * 0.3333333333333333) / z)
function code(x, y, z, t) return Float64(x - Float64(Float64(Float64(y - Float64(t / y)) * 0.3333333333333333) / z)) end
function tmp = code(x, y, z, t) tmp = x - (((y - (t / y)) * 0.3333333333333333) / z); end
code[x_, y_, z_, t_] := N[(x - N[(N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{\left(y - \frac{t}{y}\right) \cdot 0.3333333333333333}{z}
\end{array}
Initial program 95.0%
associate-+l-95.0%
sub-neg95.0%
sub-neg95.0%
distribute-neg-in95.0%
unsub-neg95.0%
neg-mul-195.0%
associate-*r/95.0%
associate-*l/95.0%
distribute-neg-frac95.0%
neg-mul-195.0%
times-frac95.7%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in y around 0 94.9%
+-commutative94.9%
metadata-eval94.9%
cancel-sign-sub-inv94.9%
associate-/r*95.6%
associate-*r/95.6%
associate-*r/95.7%
div-sub96.5%
distribute-lft-out--96.5%
Simplified96.5%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 (+ x (* y (/ -0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + (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 = x + (y * ((-0.3333333333333333d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (y * (-0.3333333333333333 / z));
}
def code(x, y, z, t): return x + (y * (-0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(y * Float64(-0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + (y * (-0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 95.0%
associate-+l-95.0%
sub-neg95.0%
sub-neg95.0%
distribute-neg-in95.0%
unsub-neg95.0%
neg-mul-195.0%
associate-*r/95.0%
associate-*l/95.0%
distribute-neg-frac95.0%
neg-mul-195.0%
times-frac95.7%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in y around inf 69.1%
Final simplification69.1%
(FPCore (x y z t) :precision binary64 (+ x (/ (* y -0.3333333333333333) z)))
double code(double x, double y, double z, double t) {
return x + ((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 = x + ((y * (-0.3333333333333333d0)) / z)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * -0.3333333333333333) / z);
}
def code(x, y, z, t): return x + ((y * -0.3333333333333333) / z)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * -0.3333333333333333) / z)) end
function tmp = code(x, y, z, t) tmp = x + ((y * -0.3333333333333333) / z); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot -0.3333333333333333}{z}
\end{array}
Initial program 95.0%
associate-+l-95.0%
sub-neg95.0%
sub-neg95.0%
distribute-neg-in95.0%
unsub-neg95.0%
neg-mul-195.0%
associate-*r/95.0%
associate-*l/95.0%
distribute-neg-frac95.0%
neg-mul-195.0%
times-frac95.7%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in y around 0 94.9%
+-commutative94.9%
metadata-eval94.9%
cancel-sign-sub-inv94.9%
associate-/r*95.6%
associate-*r/95.6%
associate-*r/95.7%
div-sub96.5%
distribute-lft-out--96.5%
Simplified96.5%
Taylor expanded in t around 0 69.1%
Final simplification69.1%
(FPCore (x y z t) :precision binary64 (- x (/ y (* z 3.0))))
double code(double x, double y, double z, double t) {
return x - (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 - (y / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x - (y / (z * 3.0));
}
def code(x, y, z, t): return x - (y / (z * 3.0))
function code(x, y, z, t) return Float64(x - Float64(y / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x - (y / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y}{z \cdot 3}
\end{array}
Initial program 95.0%
Taylor expanded in t around 0 69.1%
metadata-eval69.1%
times-frac69.1%
*-un-lft-identity69.1%
*-commutative69.1%
Applied egg-rr69.1%
Final simplification69.1%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.0%
associate-+l-95.0%
sub-neg95.0%
sub-neg95.0%
distribute-neg-in95.0%
unsub-neg95.0%
neg-mul-195.0%
associate-*r/95.0%
associate-*l/95.0%
distribute-neg-frac95.0%
neg-mul-195.0%
times-frac95.7%
distribute-lft-out--96.4%
*-commutative96.4%
associate-/r*96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in x around inf 32.6%
Final simplification32.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 2023208
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))