
(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 10 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) (/ x y)) (pow (/ t z) -2.0)))
double code(double x, double y, double z, double t) {
return ((x / y) * (x / y)) + pow((t / z), -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) * (x / y)) + ((t / z) ** (-2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (x / y)) + Math.pow((t / z), -2.0);
}
def code(x, y, z, t): return ((x / y) * (x / y)) + math.pow((t / z), -2.0)
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(x / y)) + (Float64(t / z) ^ -2.0)) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (x / y)) + ((t / z) ^ -2.0); end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[Power[N[(t / z), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \frac{x}{y} + {\left(\frac{t}{z}\right)}^{-2}
\end{array}
Initial program 67.5%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.3%
Simplified81.3%
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6483.9%
Applied egg-rr83.9%
clear-numN/A
inv-powN/A
times-fracN/A
unpow-prod-downN/A
pow-prod-upN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
metadata-eval99.6%
Applied egg-rr99.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 2e-140) (/ (/ 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)) <= 2e-140) {
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)) <= 2d-140) 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)) <= 2e-140) {
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)) <= 2e-140: 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)) <= 2e-140) 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)) <= 2e-140) 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], 2e-140], 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 2 \cdot 10^{-140}:\\
\;\;\;\;\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)) < 2e-140Initial program 67.6%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6488.3%
Simplified88.3%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6469.2%
Simplified69.2%
associate-*r/N/A
frac-timesN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6489.1%
Applied egg-rr89.1%
if 2e-140 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 67.4%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6476.2%
Simplified76.2%
Taylor expanded in x around 0
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6469.2%
Simplified69.2%
associate-*r/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.9%
Applied egg-rr78.9%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 2e-140) (* (/ 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)) <= 2e-140) {
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)) <= 2d-140) 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)) <= 2e-140) {
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)) <= 2e-140: 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)) <= 2e-140) 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)) <= 2e-140) 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], 2e-140], 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 2 \cdot 10^{-140}:\\
\;\;\;\;\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)) < 2e-140Initial program 67.6%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6488.3%
Simplified88.3%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6469.2%
Simplified69.2%
associate-*r/N/A
frac-timesN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6489.0%
Applied egg-rr89.0%
if 2e-140 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 67.4%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6476.2%
Simplified76.2%
Taylor expanded in x around 0
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6469.2%
Simplified69.2%
associate-*r/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.9%
Applied egg-rr78.9%
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (/ x y)) (* (/ z t) (/ z t))))
double code(double x, double y, double z, double t) {
return ((x / y) * (x / 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 / y) * (x / y)) + ((z / t) * (z / t))
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (x / y)) + ((z / t) * (z / t));
}
def code(x, y, z, t): return ((x / y) * (x / y)) + ((z / t) * (z / t))
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(x / y)) + Float64(Float64(z / t) * Float64(z / t))) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (x / y)) + ((z / t) * (z / t)); end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \frac{x}{y} + \frac{z}{t} \cdot \frac{z}{t}
\end{array}
Initial program 67.5%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.3%
Simplified81.3%
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6483.9%
Applied egg-rr83.9%
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6499.6%
Applied egg-rr99.6%
(FPCore (x y z t) :precision binary64 (+ (* x (/ (/ x y) y)) (/ (/ z t) (/ t z))))
double code(double x, double y, double z, double t) {
return (x * ((x / y) / y)) + ((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 * ((x / y) / y)) + ((z / t) / (t / z))
end function
public static double code(double x, double y, double z, double t) {
return (x * ((x / y) / y)) + ((z / t) / (t / z));
}
def code(x, y, z, t): return (x * ((x / y) / y)) + ((z / t) / (t / z))
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(x / y) / y)) + Float64(Float64(z / t) / Float64(t / z))) end
function tmp = code(x, y, z, t) tmp = (x * ((x / y) / y)) + ((z / t) / (t / z)); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(N[(z / t), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{\frac{x}{y}}{y} + \frac{\frac{z}{t}}{\frac{t}{z}}
\end{array}
Initial program 67.5%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.3%
Simplified81.3%
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6496.6%
Applied egg-rr96.6%
(FPCore (x y z t) :precision binary64 (+ (* (/ z t) (/ z t)) (* x (/ (/ x y) y))))
double code(double x, double y, double z, double t) {
return ((z / t) * (z / t)) + (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 = ((z / t) * (z / t)) + (x * ((x / y) / y))
end function
public static double code(double x, double y, double z, double t) {
return ((z / t) * (z / t)) + (x * ((x / y) / y));
}
def code(x, y, z, t): return ((z / t) * (z / t)) + (x * ((x / y) / y))
function code(x, y, z, t) return Float64(Float64(Float64(z / t) * Float64(z / t)) + Float64(x * Float64(Float64(x / y) / y))) end
function tmp = code(x, y, z, t) tmp = ((z / t) * (z / t)) + (x * ((x / y) / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z}{t} \cdot \frac{z}{t} + x \cdot \frac{\frac{x}{y}}{y}
\end{array}
Initial program 67.5%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.3%
Simplified81.3%
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6496.5%
Applied egg-rr96.5%
Final simplification96.5%
(FPCore (x y z t) :precision binary64 (if (<= (* t t) 1e+69) (* z (/ (/ z t) t)) (* (/ x y) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 1e+69) {
tmp = z * ((z / t) / t);
} else {
tmp = (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 ((t * t) <= 1d+69) then
tmp = z * ((z / t) / t)
else
tmp = (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 ((t * t) <= 1e+69) {
tmp = z * ((z / t) / t);
} else {
tmp = (x / y) * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t * t) <= 1e+69: tmp = z * ((z / t) / t) else: tmp = (x / y) * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(t * t) <= 1e+69) tmp = Float64(z * Float64(Float64(z / t) / t)); else tmp = Float64(Float64(x / y) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t * t) <= 1e+69) tmp = z * ((z / t) / t); else tmp = (x / y) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(t * t), $MachinePrecision], 1e+69], N[(z * N[(N[(z / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 10^{+69}:\\
\;\;\;\;z \cdot \frac{\frac{z}{t}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if (*.f64 t t) < 1.0000000000000001e69Initial program 76.4%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6486.4%
Simplified86.4%
Taylor expanded in x around 0
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6474.5%
Simplified74.5%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6477.4%
Applied egg-rr77.4%
if 1.0000000000000001e69 < (*.f64 t t) Initial program 57.1%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6475.5%
Simplified75.5%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6461.8%
Simplified61.8%
associate-*r/N/A
frac-timesN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.6%
Applied egg-rr78.6%
(FPCore (x y z t) :precision binary64 (if (<= (* t t) 1.16e+75) (* z (/ z (* t t))) (* x (/ x (* y y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 1.16e+75) {
tmp = z * (z / (t * t));
} else {
tmp = x * (x / (y * 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 ((t * t) <= 1.16d+75) then
tmp = z * (z / (t * t))
else
tmp = x * (x / (y * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 1.16e+75) {
tmp = z * (z / (t * t));
} else {
tmp = x * (x / (y * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t * t) <= 1.16e+75: tmp = z * (z / (t * t)) else: tmp = x * (x / (y * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(t * t) <= 1.16e+75) tmp = Float64(z * Float64(z / Float64(t * t))); else tmp = Float64(x * Float64(x / Float64(y * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t * t) <= 1.16e+75) tmp = z * (z / (t * t)); else tmp = x * (x / (y * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(t * t), $MachinePrecision], 1.16e+75], N[(z * N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 1.16 \cdot 10^{+75}:\\
\;\;\;\;z \cdot \frac{z}{t \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{x}{y \cdot y}\\
\end{array}
\end{array}
if (*.f64 t t) < 1.1600000000000001e75Initial program 76.4%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6486.4%
Simplified86.4%
Taylor expanded in x around 0
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6474.5%
Simplified74.5%
if 1.1600000000000001e75 < (*.f64 t t) Initial program 57.1%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6475.5%
Simplified75.5%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6461.8%
Simplified61.8%
(FPCore (x y z t) :precision binary64 (if (<= x 6.2e+30) (* z (/ (/ z t) t)) (* x (/ x (* y y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 6.2e+30) {
tmp = z * ((z / t) / t);
} else {
tmp = x * (x / (y * 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 (x <= 6.2d+30) then
tmp = z * ((z / t) / t)
else
tmp = x * (x / (y * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 6.2e+30) {
tmp = z * ((z / t) / t);
} else {
tmp = x * (x / (y * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 6.2e+30: tmp = z * ((z / t) / t) else: tmp = x * (x / (y * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 6.2e+30) tmp = Float64(z * Float64(Float64(z / t) / t)); else tmp = Float64(x * Float64(x / Float64(y * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 6.2e+30) tmp = z * ((z / t) / t); else tmp = x * (x / (y * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 6.2e+30], N[(z * N[(N[(z / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.2 \cdot 10^{+30}:\\
\;\;\;\;z \cdot \frac{\frac{z}{t}}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{x}{y \cdot y}\\
\end{array}
\end{array}
if x < 6.1999999999999995e30Initial program 67.9%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.1%
Simplified80.1%
Taylor expanded in x around 0
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6456.8%
Simplified56.8%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6463.4%
Applied egg-rr63.4%
if 6.1999999999999995e30 < x Initial program 66.2%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6485.2%
Simplified85.2%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6474.4%
Simplified74.4%
(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(x / Float64(y * y))) end
function tmp = code(x, y, z, t) tmp = x * (x / (y * y)); end
code[x_, y_, z_, t_] := N[(x * N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{x}{y \cdot y}
\end{array}
Initial program 67.5%
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.3%
Simplified81.3%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6452.9%
Simplified52.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 2024138
(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))))