
(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 (/ (/ 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 72.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-*.f6482.5%
Simplified82.5%
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6497.9%
Applied egg-rr97.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* z z) (* t t)))) (if (<= t_1 1e+281) (+ (* x (/ (/ x y) y)) t_1) (/ (/ z t) (/ t z)))))
double code(double x, double y, double z, double t) {
double t_1 = (z * z) / (t * t);
double tmp;
if (t_1 <= 1e+281) {
tmp = (x * ((x / y) / y)) + t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (z * z) / (t * t)
if (t_1 <= 1d+281) then
tmp = (x * ((x / y) / y)) + t_1
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 t_1 = (z * z) / (t * t);
double tmp;
if (t_1 <= 1e+281) {
tmp = (x * ((x / y) / y)) + t_1;
} else {
tmp = (z / t) / (t / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * z) / (t * t) tmp = 0 if t_1 <= 1e+281: tmp = (x * ((x / y) / y)) + t_1 else: tmp = (z / t) / (t / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * z) / Float64(t * t)) tmp = 0.0 if (t_1 <= 1e+281) tmp = Float64(Float64(x * Float64(Float64(x / y) / y)) + t_1); else tmp = Float64(Float64(z / t) / Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * z) / (t * t); tmp = 0.0; if (t_1 <= 1e+281) tmp = (x * ((x / y) / y)) + t_1; else tmp = (z / t) / (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+281], N[(N[(x * N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(z / t), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot z}{t \cdot t}\\
\mathbf{if}\;t\_1 \leq 10^{+281}:\\
\;\;\;\;x \cdot \frac{\frac{x}{y}}{y} + t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{z}{t}}{\frac{t}{z}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 1e281Initial program 81.3%
+-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-*.f6494.0%
Simplified94.0%
if 1e281 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 61.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-*.f6469.1%
Simplified69.1%
Taylor expanded in x around 0
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6477.9%
Simplified77.9%
associate-*r/N/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6486.3%
Applied egg-rr86.3%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* x x) (* y y)) 0.05) (/ (/ z t) (/ t z)) (/ (/ x y) (/ y x))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * x) / (y * y)) <= 0.05) {
tmp = (z / t) / (t / z);
} else {
tmp = (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 (((x * x) / (y * y)) <= 0.05d0) then
tmp = (z / t) / (t / z)
else
tmp = (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 (((x * x) / (y * y)) <= 0.05) {
tmp = (z / t) / (t / z);
} else {
tmp = (x / y) / (y / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * x) / (y * y)) <= 0.05: tmp = (z / t) / (t / z) else: tmp = (x / y) / (y / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * x) / Float64(y * y)) <= 0.05) tmp = Float64(Float64(z / t) / Float64(t / z)); else tmp = Float64(Float64(x / y) / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x * x) / (y * y)) <= 0.05) tmp = (z / t) / (t / z); else tmp = (x / y) / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision], 0.05], N[(N[(z / t), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot x}{y \cdot y} \leq 0.05:\\
\;\;\;\;\frac{\frac{z}{t}}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < 0.050000000000000003Initial program 78.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-*.f6479.6%
Simplified79.6%
Taylor expanded in x around 0
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.5%
Simplified75.5%
associate-*r/N/A
times-fracN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6488.7%
Applied egg-rr88.7%
if 0.050000000000000003 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 66.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-*.f6484.9%
Simplified84.9%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.7%
Simplified75.7%
associate-/r*N/A
*-commutativeN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6482.0%
Applied egg-rr82.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* x x) (* y y)) 0.05) (* (/ z t) (/ z t)) (/ (/ x y) (/ y x))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * x) / (y * y)) <= 0.05) {
tmp = (z / t) * (z / t);
} else {
tmp = (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 (((x * x) / (y * y)) <= 0.05d0) then
tmp = (z / t) * (z / t)
else
tmp = (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 (((x * x) / (y * y)) <= 0.05) {
tmp = (z / t) * (z / t);
} else {
tmp = (x / y) / (y / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * x) / (y * y)) <= 0.05: tmp = (z / t) * (z / t) else: tmp = (x / y) / (y / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * x) / Float64(y * y)) <= 0.05) tmp = Float64(Float64(z / t) * Float64(z / t)); else tmp = Float64(Float64(x / y) / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x * x) / (y * y)) <= 0.05) tmp = (z / t) * (z / t); else tmp = (x / y) / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision], 0.05], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot x}{y \cdot y} \leq 0.05:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < 0.050000000000000003Initial program 78.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-*.f6479.6%
Simplified79.6%
Taylor expanded in x around 0
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.5%
Simplified75.5%
associate-*r/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6488.5%
Applied egg-rr88.5%
if 0.050000000000000003 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 66.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-*.f6484.9%
Simplified84.9%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.7%
Simplified75.7%
associate-/r*N/A
*-commutativeN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6482.0%
Applied egg-rr82.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* x x) (* y y)) 0.05) (* (/ z t) (/ z t)) (* (/ x y) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x * x) / (y * y)) <= 0.05) {
tmp = (z / t) * (z / 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 (((x * x) / (y * y)) <= 0.05d0) then
tmp = (z / t) * (z / 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 (((x * x) / (y * y)) <= 0.05) {
tmp = (z / t) * (z / t);
} else {
tmp = (x / y) * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x * x) / (y * y)) <= 0.05: tmp = (z / t) * (z / t) else: tmp = (x / y) * (x / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(x * x) / Float64(y * y)) <= 0.05) tmp = Float64(Float64(z / t) * Float64(z / 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 (((x * x) / (y * y)) <= 0.05) tmp = (z / t) * (z / t); else tmp = (x / y) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision], 0.05], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot x}{y \cdot y} \leq 0.05:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < 0.050000000000000003Initial program 78.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-*.f6479.6%
Simplified79.6%
Taylor expanded in x around 0
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.5%
Simplified75.5%
associate-*r/N/A
times-fracN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6488.5%
Applied egg-rr88.5%
if 0.050000000000000003 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 66.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-*.f6484.9%
Simplified84.9%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6475.7%
Simplified75.7%
associate-*r/N/A
frac-timesN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6481.9%
Applied egg-rr81.9%
(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(x * Float64(Float64(x / y) / y)) + Float64(Float64(z * Float64(z / 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[(x * N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(z / t), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{\frac{x}{y}}{y} + \frac{z \cdot \frac{z}{t}}{t}
\end{array}
Initial program 72.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-*.f6482.5%
Simplified82.5%
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6495.3%
Applied egg-rr95.3%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (if (<= (* t t) 3.6e+83) (* z (/ z (* t t))) (* (/ x y) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t * t) <= 3.6e+83) {
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) <= 3.6d+83) 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) <= 3.6e+83) {
tmp = z * (z / (t * t));
} else {
tmp = (x / y) * (x / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t * t) <= 3.6e+83: 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) <= 3.6e+83) tmp = Float64(z * Float64(z / Float64(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) <= 3.6e+83) 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], 3.6e+83], N[(z * N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \cdot t \leq 3.6 \cdot 10^{+83}:\\
\;\;\;\;z \cdot \frac{z}{t \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if (*.f64 t t) < 3.5999999999999997e83Initial program 75.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-*.f6483.7%
Simplified83.7%
Taylor expanded in x around 0
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6473.6%
Simplified73.6%
if 3.5999999999999997e83 < (*.f64 t t) 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-*.f6480.9%
Simplified80.9%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6468.9%
Simplified68.9%
associate-*r/N/A
frac-timesN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6481.1%
Applied egg-rr81.1%
(FPCore (x y z t) :precision binary64 (if (<= (* y y) 9.2e+137) (* x (/ x (* y y))) (* z (/ z (* t t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y * y) <= 9.2e+137) {
tmp = x * (x / (y * y));
} else {
tmp = 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 ((y * y) <= 9.2d+137) then
tmp = x * (x / (y * y))
else
tmp = 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 ((y * y) <= 9.2e+137) {
tmp = x * (x / (y * y));
} else {
tmp = z * (z / (t * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y * y) <= 9.2e+137: tmp = x * (x / (y * y)) else: tmp = z * (z / (t * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(y * y) <= 9.2e+137) tmp = Float64(x * Float64(x / Float64(y * y))); else tmp = Float64(z * Float64(z / Float64(t * t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y * y) <= 9.2e+137) tmp = x * (x / (y * y)); else tmp = z * (z / (t * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(y * y), $MachinePrecision], 9.2e+137], N[(x * N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot y \leq 9.2 \cdot 10^{+137}:\\
\;\;\;\;x \cdot \frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{z}{t \cdot t}\\
\end{array}
\end{array}
if (*.f64 y y) < 9.19999999999999997e137Initial program 77.0%
+-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.9%
Simplified85.9%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6473.0%
Simplified73.0%
if 9.19999999999999997e137 < (*.f64 y y) Initial program 65.0%
+-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-*.f6477.5%
Simplified77.5%
Taylor expanded in x around 0
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6471.3%
Simplified71.3%
(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 72.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-*.f6482.5%
Simplified82.5%
Taylor expanded in x around inf
unpow2N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6454.4%
Simplified54.4%
(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 2024140
(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))))