
(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 9 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 y) (/ y x)) (/ (/ z t) (/ t z))))
double code(double x, double y, double z, double t) {
return ((x / y) / (y / x)) + ((z / t) / (t / 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) / (y / x)) + ((z / t) / (t / z))
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) / (y / x)) + ((z / t) / (t / z));
}
def code(x, y, z, t): return ((x / y) / (y / x)) + ((z / t) / (t / z))
function code(x, y, z, t) return Float64(Float64(Float64(x / y) / Float64(y / x)) + Float64(Float64(z / t) / Float64(t / z))) end
function tmp = code(x, y, z, t) tmp = ((x / y) / (y / x)) + ((z / t) / (t / z)); end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / t), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{y}}{\frac{y}{x}} + \frac{\frac{z}{t}}{\frac{t}{z}}
\end{array}
Initial program 69.7%
+-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.3%
Simplified88.3%
associate-*r/N/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6497.6%
Applied egg-rr97.6%
associate-*l/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
(FPCore (x y z t) :precision binary64 (if (<= (* t t) 0.0) (* (/ z t) (/ z t)) (+ (* (/ x y) (/ x y)) (* z (/ z (* t t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 0.0) {
tmp = (z / t) * (z / t);
} else {
tmp = ((x / y) * (x / y)) + (z * (z / (t * t)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t * t) <= 0.0d0) then
tmp = (z / t) * (z / t)
else
tmp = ((x / y) * (x / y)) + (z * (z / (t * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 0.0) {
tmp = (z / t) * (z / t);
} else {
tmp = ((x / y) * (x / y)) + (z * (z / (t * t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t * t) <= 0.0: tmp = (z / t) * (z / t) else: tmp = ((x / y) * (x / y)) + (z * (z / (t * t))) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(t * t) <= 0.0) tmp = Float64(Float64(z / t) * Float64(z / t)); else tmp = Float64(Float64(Float64(x / y) * Float64(x / y)) + Float64(z * Float64(z / Float64(t * t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t * t) <= 0.0) tmp = (z / t) * (z / t); else tmp = ((x / y) * (x / y)) + (z * (z / (t * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(t * t), $MachinePrecision], 0.0], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(z * N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 0:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + z \cdot \frac{z}{t \cdot t}\\
\end{array}
\end{array}
if (*.f64 t t) < 0.0Initial program 64.0%
+-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-*.f6476.3%
Simplified76.3%
associate-*r/N/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6498.3%
Applied egg-rr98.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6469.1%
Simplified69.1%
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6487.2%
Applied egg-rr87.2%
if 0.0 < (*.f64 t t) Initial program 71.5%
+-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-*.f6492.0%
Simplified92.0%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6494.4%
Applied egg-rr94.4%
(FPCore (x y z t) :precision binary64 (if (<= x 1e-243) (/ (/ z t) (/ t z)) (+ (* (/ x y) (/ x y)) (/ z (/ t (/ z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1e-243) {
tmp = (z / t) / (t / z);
} else {
tmp = ((x / y) * (x / y)) + (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 (x <= 1d-243) then
tmp = (z / t) / (t / z)
else
tmp = ((x / y) * (x / y)) + (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 (x <= 1e-243) {
tmp = (z / t) / (t / z);
} else {
tmp = ((x / y) * (x / y)) + (z / (t / (z / t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 1e-243: tmp = (z / t) / (t / z) else: tmp = ((x / y) * (x / y)) + (z / (t / (z / t))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 1e-243) tmp = Float64(Float64(z / t) / Float64(t / z)); else tmp = Float64(Float64(Float64(x / y) * Float64(x / y)) + Float64(z / Float64(t / Float64(z / t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 1e-243) tmp = (z / t) / (t / z); else tmp = ((x / y) * (x / y)) + (z / (t / (z / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 1e-243], N[(N[(z / t), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(z / N[(t / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{-243}:\\
\;\;\;\;\frac{\frac{z}{t}}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + \frac{z}{\frac{t}{\frac{z}{t}}}\\
\end{array}
\end{array}
if x < 9.99999999999999995e-244Initial program 70.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-*.f6487.5%
Simplified87.5%
associate-*r/N/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6497.9%
Applied egg-rr97.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.3%
Simplified52.3%
times-fracN/A
clear-numN/A
div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6461.3%
Applied egg-rr61.3%
if 9.99999999999999995e-244 < x Initial program 69.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.4%
Simplified89.4%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6491.9%
Applied egg-rr91.9%
clear-numN/A
un-div-invN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6499.0%
Applied egg-rr99.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 5e-72) (/ (/ x y) (/ y x)) (/ (/ z t) (/ t z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) / (t * t)) <= 5e-72) {
tmp = (x / y) / (y / x);
} else {
tmp = (z / t) / (t / 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 (((z * z) / (t * t)) <= 5d-72) then
tmp = (x / y) / (y / x)
else
tmp = (z / t) / (t / z)
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)) <= 5e-72) {
tmp = (x / y) / (y / x);
} else {
tmp = (z / t) / (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * z) / (t * t)) <= 5e-72: tmp = (x / y) / (y / x) else: tmp = (z / t) / (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(z * z) / Float64(t * t)) <= 5e-72) tmp = Float64(Float64(x / y) / Float64(y / x)); else tmp = Float64(Float64(z / t) / Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * z) / (t * t)) <= 5e-72) tmp = (x / y) / (y / x); else tmp = (z / t) / (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision], 5e-72], N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(z / t), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 5 \cdot 10^{-72}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{z}{t}}{\frac{t}{z}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 4.9999999999999996e-72Initial program 72.6%
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-/.f6484.2%
Simplified84.2%
associate-*r/N/A
associate-*l/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6492.5%
Applied egg-rr92.5%
if 4.9999999999999996e-72 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 67.6%
+-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-*.f6484.8%
Simplified84.8%
associate-*r/N/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6499.2%
Applied egg-rr99.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.3%
Simplified67.3%
times-fracN/A
clear-numN/A
div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6479.7%
Applied egg-rr79.7%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 5e-72) (/ (/ 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)) <= 5e-72) {
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)) <= 5d-72) 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)) <= 5e-72) {
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)) <= 5e-72: 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)) <= 5e-72) tmp = Float64(Float64(x / y) / Float64(y / x)); else tmp = Float64(Float64(z / t) * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * z) / (t * t)) <= 5e-72) 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], 5e-72], N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 5 \cdot 10^{-72}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 4.9999999999999996e-72Initial program 72.6%
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-/.f6484.2%
Simplified84.2%
associate-*r/N/A
associate-*l/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6492.5%
Applied egg-rr92.5%
if 4.9999999999999996e-72 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 67.6%
+-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-*.f6484.8%
Simplified84.8%
associate-*r/N/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6499.2%
Applied egg-rr99.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.3%
Simplified67.3%
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6479.6%
Applied egg-rr79.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 5e-72) (* (/ 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)) <= 5e-72) {
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)) <= 5d-72) 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)) <= 5e-72) {
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)) <= 5e-72: 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)) <= 5e-72) tmp = Float64(Float64(x / y) * Float64(x / y)); else tmp = Float64(Float64(z / t) * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * z) / (t * t)) <= 5e-72) 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], 5e-72], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{z \cdot z}{t \cdot t} \leq 5 \cdot 10^{-72}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 4.9999999999999996e-72Initial program 72.6%
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-/.f6484.2%
Simplified84.2%
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6492.4%
Applied egg-rr92.4%
if 4.9999999999999996e-72 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 67.6%
+-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-*.f6484.8%
Simplified84.8%
associate-*r/N/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6499.2%
Applied egg-rr99.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.3%
Simplified67.3%
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6479.6%
Applied egg-rr79.6%
(FPCore (x y z t) :precision binary64 (+ (/ (/ z t) (/ t z)) (* (/ x y) (/ x y))))
double code(double x, double y, double z, double t) {
return ((z / t) / (t / z)) + ((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 = ((z / t) / (t / z)) + ((x / y) * (x / y))
end function
public static double code(double x, double y, double z, double t) {
return ((z / t) / (t / z)) + ((x / y) * (x / y));
}
def code(x, y, z, t): return ((z / t) / (t / z)) + ((x / y) * (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(z / t) / Float64(t / z)) + Float64(Float64(x / y) * Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = ((z / t) / (t / z)) + ((x / y) * (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(z / t), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{z}{t}}{\frac{t}{z}} + \frac{x}{y} \cdot \frac{x}{y}
\end{array}
Initial program 69.7%
+-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.3%
Simplified88.3%
associate-*r/N/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6497.6%
Applied egg-rr97.6%
associate-*l/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
div-invN/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
Final simplification99.8%
(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 69.7%
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.2%
Simplified57.2%
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6461.5%
Applied egg-rr61.5%
(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 69.7%
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.2%
Simplified57.2%
(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 2024158
(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))))