
(FPCore (x y z t) :precision binary64 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
double code(double x, double y, double z, double t) {
return ((x * x) / (y * y)) + ((z * z) / (t * 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 * x) / (y * y)) + ((z * z) / (t * t))
end function
public static double code(double x, double y, double z, double t) {
return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
def code(x, y, z, t): return ((x * x) / (y * y)) + ((z * z) / (t * t))
function code(x, y, z, t) return Float64(Float64(Float64(x * x) / Float64(y * y)) + Float64(Float64(z * z) / Float64(t * t))) end
function tmp = code(x, y, z, t) tmp = ((x * x) / (y * y)) + ((z * z) / (t * t)); end
code[x_, y_, z_, t_] := N[(N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
double code(double x, double y, double z, double t) {
return ((x * x) / (y * y)) + ((z * z) / (t * 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 * x) / (y * y)) + ((z * z) / (t * t))
end function
public static double code(double x, double y, double z, double t) {
return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
def code(x, y, z, t): return ((x * x) / (y * y)) + ((z * z) / (t * t))
function code(x, y, z, t) return Float64(Float64(Float64(x * x) / Float64(y * y)) + Float64(Float64(z * z) / Float64(t * t))) end
function tmp = code(x, y, z, t) tmp = ((x * x) / (y * y)) + ((z * z) / (t * t)); end
code[x_, y_, z_, t_] := N[(N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\end{array}
(FPCore (x y z t) :precision binary64 (+ (/ (* x (/ x y)) y) (* (/ z t) (/ z t))))
double code(double x, double y, double z, double t) {
return ((x * (x / y)) / y) + ((z / t) * (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 * (x / y)) / y) + ((z / t) * (z / t))
end function
public static double code(double x, double y, double z, double t) {
return ((x * (x / y)) / y) + ((z / t) * (z / t));
}
def code(x, y, z, t): return ((x * (x / y)) / y) + ((z / t) * (z / t))
function code(x, y, z, t) return Float64(Float64(Float64(x * Float64(x / y)) / y) + Float64(Float64(z / t) * Float64(z / t))) end
function tmp = code(x, y, z, t) tmp = ((x * (x / y)) / y) + ((z / t) * (z / t)); end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \frac{x}{y}}{y} + \frac{z}{t} \cdot \frac{z}{t}
\end{array}
Initial program 67.4%
+-lowering-+.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.7%
Simplified88.7%
associate-*r/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6497.2%
Applied egg-rr97.2%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 0.0) (/ (/ x y) (/ y x)) (+ (/ z (/ t (/ z t))) (/ x (* y (/ y x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) / (t * t)) <= 0.0) {
tmp = (x / y) / (y / x);
} else {
tmp = (z / (t / (z / t))) + (x / (y * (y / x)));
}
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 (((z * z) / (t * t)) <= 0.0d0) then
tmp = (x / y) / (y / x)
else
tmp = (z / (t / (z / t))) + (x / (y * (y / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) / (t * t)) <= 0.0) {
tmp = (x / y) / (y / x);
} else {
tmp = (z / (t / (z / t))) + (x / (y * (y / x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * z) / (t * t)) <= 0.0: tmp = (x / y) / (y / x) else: tmp = (z / (t / (z / t))) + (x / (y * (y / x))) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(z * z) / Float64(t * t)) <= 0.0) tmp = Float64(Float64(x / y) / Float64(y / x)); else tmp = Float64(Float64(z / Float64(t / Float64(z / t))) + Float64(x / Float64(y * Float64(y / x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * z) / (t * t)) <= 0.0) tmp = (x / y) / (y / x); else tmp = (z / (t / (z / t))) + (x / (y * (y / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(z / N[(t / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(y * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 0:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{\frac{z}{t}}} + \frac{x}{y \cdot \frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 0.0Initial program 64.0%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6481.8%
Simplified81.8%
associate-*r/N/A
associate-*l/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6491.0%
Applied egg-rr91.0%
if 0.0 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 69.3%
associate-*r/N/A
+-commutativeN/A
+-lowering-+.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6496.7%
Applied egg-rr96.7%
Final simplification94.7%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 0.0) (/ (/ x y) (/ y x)) (+ (* z (/ z (* t t))) (/ x (/ y (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) / (t * t)) <= 0.0) {
tmp = (x / y) / (y / x);
} else {
tmp = (z * (z / (t * t))) + (x / (y / (x / y)));
}
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 (((z * z) / (t * t)) <= 0.0d0) then
tmp = (x / y) / (y / x)
else
tmp = (z * (z / (t * t))) + (x / (y / (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) / (t * t)) <= 0.0) {
tmp = (x / y) / (y / x);
} else {
tmp = (z * (z / (t * t))) + (x / (y / (x / y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * z) / (t * t)) <= 0.0: tmp = (x / y) / (y / x) else: tmp = (z * (z / (t * t))) + (x / (y / (x / y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(z * z) / Float64(t * t)) <= 0.0) tmp = Float64(Float64(x / y) / Float64(y / x)); else tmp = Float64(Float64(z * Float64(z / Float64(t * t))) + Float64(x / Float64(y / Float64(x / y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * z) / (t * t)) <= 0.0) tmp = (x / y) / (y / x); else tmp = (z * (z / (t * t))) + (x / (y / (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(y / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 0:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{z}{t \cdot t} + \frac{x}{\frac{y}{\frac{x}{y}}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 0.0Initial program 64.0%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6481.8%
Simplified81.8%
associate-*r/N/A
associate-*l/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6491.0%
Applied egg-rr91.0%
if 0.0 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 69.3%
+-lowering-+.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6489.0%
Simplified89.0%
associate-/l*N/A
associate-/r*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f6488.3%
Applied egg-rr88.3%
Final simplification89.2%
(FPCore (x y z t) :precision binary64 (if (<= y 6.9e-218) (+ (/ (* x (/ x y)) y) (* z (/ z (* t t)))) (+ (/ z (/ t (/ z t))) (/ x (* y (/ y x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.9e-218) {
tmp = ((x * (x / y)) / y) + (z * (z / (t * t)));
} else {
tmp = (z / (t / (z / t))) + (x / (y * (y / x)));
}
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 <= 6.9d-218) then
tmp = ((x * (x / y)) / y) + (z * (z / (t * t)))
else
tmp = (z / (t / (z / t))) + (x / (y * (y / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.9e-218) {
tmp = ((x * (x / y)) / y) + (z * (z / (t * t)));
} else {
tmp = (z / (t / (z / t))) + (x / (y * (y / x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 6.9e-218: tmp = ((x * (x / y)) / y) + (z * (z / (t * t))) else: tmp = (z / (t / (z / t))) + (x / (y * (y / x))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 6.9e-218) tmp = Float64(Float64(Float64(x * Float64(x / y)) / y) + Float64(z * Float64(z / Float64(t * t)))); else tmp = Float64(Float64(z / Float64(t / Float64(z / t))) + Float64(x / Float64(y * Float64(y / x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 6.9e-218) tmp = ((x * (x / y)) / y) + (z * (z / (t * t))); else tmp = (z / (t / (z / t))) + (x / (y * (y / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 6.9e-218], N[(N[(N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(z * N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / N[(t / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(y * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.9 \cdot 10^{-218}:\\
\;\;\;\;\frac{x \cdot \frac{x}{y}}{y} + z \cdot \frac{z}{t \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{\frac{z}{t}}} + \frac{x}{y \cdot \frac{y}{x}}\\
\end{array}
\end{array}
if y < 6.90000000000000034e-218Initial program 67.2%
+-lowering-+.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6489.6%
Simplified89.6%
if 6.90000000000000034e-218 < y Initial program 67.8%
associate-*r/N/A
+-commutativeN/A
+-lowering-+.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
clear-numN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
times-fracN/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6494.5%
Applied egg-rr94.5%
Final simplification91.5%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 4e+61) (/ (/ x y) (/ y x)) (/ z (/ t (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) / (t * t)) <= 4e+61) {
tmp = (x / y) / (y / x);
} else {
tmp = z / (t / (z / 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 (((z * z) / (t * t)) <= 4d+61) then
tmp = (x / y) / (y / x)
else
tmp = z / (t / (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) / (t * t)) <= 4e+61) {
tmp = (x / y) / (y / x);
} else {
tmp = z / (t / (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * z) / (t * t)) <= 4e+61: tmp = (x / y) / (y / x) else: tmp = z / (t / (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(z * z) / Float64(t * t)) <= 4e+61) tmp = Float64(Float64(x / y) / Float64(y / x)); else tmp = Float64(z / Float64(t / Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * z) / (t * t)) <= 4e+61) tmp = (x / y) / (y / x); else tmp = z / (t / (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision], 4e+61], N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision], N[(z / N[(t / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 4 \cdot 10^{+61}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{\frac{z}{t}}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 3.9999999999999998e61Initial program 65.9%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6477.1%
Simplified77.1%
associate-*r/N/A
associate-*l/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.3%
Applied egg-rr86.3%
if 3.9999999999999998e61 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 68.8%
Taylor expanded in x around 0
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.7%
Simplified75.7%
associate-/l/N/A
frac-timesN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6484.2%
Applied egg-rr84.2%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 4e+61) (* (/ x y) (/ x y)) (/ z (/ t (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) / (t * t)) <= 4e+61) {
tmp = (x / y) * (x / y);
} else {
tmp = z / (t / (z / 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 (((z * z) / (t * t)) <= 4d+61) then
tmp = (x / y) * (x / y)
else
tmp = z / (t / (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) / (t * t)) <= 4e+61) {
tmp = (x / y) * (x / y);
} else {
tmp = z / (t / (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * z) / (t * t)) <= 4e+61: tmp = (x / y) * (x / y) else: tmp = z / (t / (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(z * z) / Float64(t * t)) <= 4e+61) tmp = Float64(Float64(x / y) * Float64(x / y)); else tmp = Float64(z / Float64(t / Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * z) / (t * t)) <= 4e+61) tmp = (x / y) * (x / y); else tmp = z / (t / (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision], 4e+61], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(z / N[(t / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 4 \cdot 10^{+61}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{\frac{z}{t}}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 3.9999999999999998e61Initial program 65.9%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6477.1%
Simplified77.1%
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.1%
Applied egg-rr86.1%
if 3.9999999999999998e61 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 68.8%
Taylor expanded in x around 0
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.7%
Simplified75.7%
associate-/l/N/A
frac-timesN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6484.2%
Applied egg-rr84.2%
(FPCore (x y z t) :precision binary64 (* (/ x y) (/ x y)))
double code(double x, double y, double z, double t) {
return (x / y) * (x / 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) * (x / y)
end function
public static double code(double x, double y, double z, double t) {
return (x / y) * (x / y);
}
def code(x, y, z, t): return (x / y) * (x / y)
function code(x, y, z, t) return Float64(Float64(x / y) * Float64(x / y)) end
function tmp = code(x, y, z, t) tmp = (x / y) * (x / y); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \frac{x}{y}
\end{array}
Initial program 67.4%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6457.9%
Simplified57.9%
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6461.1%
Applied egg-rr61.1%
(FPCore (x y z t) :precision binary64 (* x (/ (/ x y) y)))
double code(double x, double y, double z, double t) {
return x * ((x / y) / 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 * ((x / y) / y)
end function
public static double code(double x, double y, double z, double t) {
return x * ((x / y) / y);
}
def code(x, y, z, t): return x * ((x / y) / y)
function code(x, y, z, t) return Float64(x * Float64(Float64(x / y) / y)) end
function tmp = code(x, y, z, t) tmp = x * ((x / y) / y); end
code[x_, y_, z_, t_] := N[(x * N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{\frac{x}{y}}{y}
\end{array}
Initial program 67.4%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6457.9%
Simplified57.9%
(FPCore (x y z t) :precision binary64 (+ (pow (/ x y) 2.0) (pow (/ z t) 2.0)))
double code(double x, double y, double z, double t) {
return pow((x / y), 2.0) + pow((z / t), 2.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) ** 2.0d0) + ((z / t) ** 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return Math.pow((x / y), 2.0) + Math.pow((z / t), 2.0);
}
def code(x, y, z, t): return math.pow((x / y), 2.0) + math.pow((z / t), 2.0)
function code(x, y, z, t) return Float64((Float64(x / y) ^ 2.0) + (Float64(z / t) ^ 2.0)) end
function tmp = code(x, y, z, t) tmp = ((x / y) ^ 2.0) + ((z / t) ^ 2.0); end
code[x_, y_, z_, t_] := N[(N[Power[N[(x / y), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(z / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}
\end{array}
herbie shell --seed 2024161
(FPCore (x y z t)
:name "Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1"
:precision binary64
:alt
(! :herbie-platform default (+ (pow (/ x y) 2) (pow (/ z t) 2)))
(+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))