
(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 y) (/ y x)) (* (/ z t) (/ z t))))
double code(double x, double y, double z, double t) {
return ((x / y) / (y / x)) + ((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) / (y / x)) + ((z / t) * (z / t))
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) / (y / x)) + ((z / t) * (z / t));
}
def code(x, y, z, t): return ((x / y) / (y / x)) + ((z / t) * (z / t))
function code(x, y, z, t) return Float64(Float64(Float64(x / y) / Float64(y / x)) + Float64(Float64(z / t) * Float64(z / t))) end
function tmp = code(x, y, z, t) tmp = ((x / y) / (y / x)) + ((z / t) * (z / t)); end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{y}}{\frac{y}{x}} + \frac{z}{t} \cdot \frac{z}{t}
\end{array}
Initial program 69.1%
times-frac83.4%
Simplified83.4%
frac-times99.7%
Applied egg-rr99.7%
clear-num99.7%
un-div-inv99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 5e-170) (* (/ t (* y t)) (/ (* x x) y)) (* (/ z t) (/ z t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) / (t * t)) <= 5e-170) {
tmp = (t / (y * t)) * ((x * 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-170) then
tmp = (t / (y * t)) * ((x * 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-170) {
tmp = (t / (y * t)) * ((x * x) / y);
} else {
tmp = (z / t) * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * z) / (t * t)) <= 5e-170: tmp = (t / (y * t)) * ((x * 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-170) tmp = Float64(Float64(t / Float64(y * t)) * Float64(Float64(x * 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-170) tmp = (t / (y * t)) * ((x * 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-170], N[(N[(t / N[(y * t), $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] / 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^{-170}:\\
\;\;\;\;\frac{t}{y \cdot t} \cdot \frac{x \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 5.0000000000000001e-170Initial program 76.2%
associate-*l/83.4%
*-commutative83.4%
fma-def83.4%
Simplified83.4%
fma-udef83.4%
associate-*r/76.2%
frac-times98.5%
frac-times99.6%
+-commutative99.6%
frac-times98.5%
associate-/r*99.6%
associate-*l/94.0%
frac-add79.8%
fma-def79.8%
associate-*r/79.8%
Applied egg-rr79.8%
associate-*r*82.1%
*-commutative82.1%
associate-*l*81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in z around 0 70.4%
unpow270.4%
associate-*r/70.6%
associate-*l/76.4%
Simplified76.4%
associate-/l*82.4%
associate-/r/83.5%
associate-*l/75.3%
Applied egg-rr75.3%
if 5.0000000000000001e-170 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 65.8%
associate-*l/74.4%
*-commutative74.4%
fma-def74.4%
Simplified74.4%
fma-udef74.4%
associate-*r/65.8%
frac-times75.0%
frac-times99.7%
+-commutative99.7%
frac-times75.0%
clear-num74.9%
frac-times65.8%
associate-/l*74.4%
frac-add36.5%
*-un-lft-identity36.5%
associate-/l*38.8%
times-frac40.5%
times-frac52.3%
associate-/l*60.4%
Applied egg-rr60.4%
associate-/l*53.4%
associate-*r/60.3%
*-commutative60.3%
associate-*r/59.7%
associate-/r/59.7%
associate-*r/58.7%
associate-/r/58.6%
associate-/l*51.1%
associate-*r/58.7%
Simplified58.7%
Taylor expanded in y around inf 69.0%
unpow269.0%
unpow269.0%
Simplified69.0%
frac-times81.3%
Applied egg-rr81.3%
Final simplification79.4%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 5e-170) (* (/ x y) (/ (* (/ x y) t) t)) (* (/ z t) (/ z t))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * z) / (t * t)) <= 5e-170) {
tmp = (x / y) * (((x / y) * t) / t);
} 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-170) then
tmp = (x / y) * (((x / y) * t) / t)
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-170) {
tmp = (x / y) * (((x / y) * t) / t);
} else {
tmp = (z / t) * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * z) / (t * t)) <= 5e-170: tmp = (x / y) * (((x / y) * t) / t) 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-170) tmp = Float64(Float64(x / y) * Float64(Float64(Float64(x / y) * t) / t)); 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-170) tmp = (x / y) * (((x / y) * t) / t); 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-170], N[(N[(x / y), $MachinePrecision] * N[(N[(N[(x / y), $MachinePrecision] * t), $MachinePrecision] / t), $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^{-170}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{\frac{x}{y} \cdot t}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 5.0000000000000001e-170Initial program 76.2%
associate-*l/83.4%
*-commutative83.4%
fma-def83.4%
Simplified83.4%
fma-udef83.4%
associate-*r/76.2%
frac-times98.5%
frac-times99.6%
+-commutative99.6%
frac-times98.5%
associate-/r*99.6%
associate-*l/94.0%
frac-add79.8%
fma-def79.8%
associate-*r/79.8%
Applied egg-rr79.8%
associate-*r*82.1%
*-commutative82.1%
associate-*l*81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in z around 0 70.4%
unpow270.4%
associate-*r/70.6%
associate-*l/76.4%
Simplified76.4%
associate-*r*77.6%
*-commutative77.6%
times-frac90.5%
*-commutative90.5%
Applied egg-rr90.5%
if 5.0000000000000001e-170 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 65.8%
associate-*l/74.4%
*-commutative74.4%
fma-def74.4%
Simplified74.4%
fma-udef74.4%
associate-*r/65.8%
frac-times75.0%
frac-times99.7%
+-commutative99.7%
frac-times75.0%
clear-num74.9%
frac-times65.8%
associate-/l*74.4%
frac-add36.5%
*-un-lft-identity36.5%
associate-/l*38.8%
times-frac40.5%
times-frac52.3%
associate-/l*60.4%
Applied egg-rr60.4%
associate-/l*53.4%
associate-*r/60.3%
*-commutative60.3%
associate-*r/59.7%
associate-/r/59.7%
associate-*r/58.7%
associate-/r/58.6%
associate-/l*51.1%
associate-*r/58.7%
Simplified58.7%
Taylor expanded in y around inf 69.0%
unpow269.0%
unpow269.0%
Simplified69.0%
frac-times81.3%
Applied egg-rr81.3%
Final simplification84.3%
(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 69.1%
times-frac83.4%
Simplified83.4%
frac-times99.7%
Applied egg-rr99.7%
clear-num99.7%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 83.4%
unpow283.4%
unpow283.4%
associate-*r/92.7%
associate-/r*98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (+ (* (/ z t) (/ z t)) (* (/ x y) (/ x y))))
double code(double x, double y, double z, double t) {
return ((z / t) * (z / t)) + ((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) * (z / t)) + ((x / y) * (x / y))
end function
public static double code(double x, double y, double z, double t) {
return ((z / t) * (z / t)) + ((x / y) * (x / y));
}
def code(x, y, z, t): return ((z / t) * (z / t)) + ((x / y) * (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(z / t) * Float64(z / t)) + Float64(Float64(x / y) * Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = ((z / t) * (z / t)) + ((x / y) * (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z}{t} \cdot \frac{z}{t} + \frac{x}{y} \cdot \frac{x}{y}
\end{array}
Initial program 69.1%
times-frac83.4%
Simplified83.4%
frac-times99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (if (<= x 2.9e+94) (* (/ z t) (/ z t)) (* z (* z (/ 1.0 (* t t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.9e+94) {
tmp = (z / t) * (z / t);
} else {
tmp = z * (z * (1.0 / (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 (x <= 2.9d+94) then
tmp = (z / t) * (z / t)
else
tmp = z * (z * (1.0d0 / (t * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.9e+94) {
tmp = (z / t) * (z / t);
} else {
tmp = z * (z * (1.0 / (t * t)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 2.9e+94: tmp = (z / t) * (z / t) else: tmp = z * (z * (1.0 / (t * t))) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 2.9e+94) tmp = Float64(Float64(z / t) * Float64(z / t)); else tmp = Float64(z * Float64(z * Float64(1.0 / Float64(t * t)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= 2.9e+94) tmp = (z / t) * (z / t); else tmp = z * (z * (1.0 / (t * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 2.9e+94], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(z * N[(z * N[(1.0 / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.9 \cdot 10^{+94}:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(z \cdot \frac{1}{t \cdot t}\right)\\
\end{array}
\end{array}
if x < 2.8999999999999998e94Initial program 71.8%
associate-*l/79.7%
*-commutative79.7%
fma-def79.7%
Simplified79.7%
fma-udef79.7%
associate-*r/71.8%
frac-times83.3%
frac-times99.7%
+-commutative99.7%
frac-times83.3%
clear-num83.2%
frac-times71.8%
associate-/l*79.7%
frac-add27.8%
*-un-lft-identity27.8%
associate-/l*29.7%
times-frac30.6%
times-frac39.7%
associate-/l*44.0%
Applied egg-rr44.0%
associate-/l*39.6%
associate-*r/43.9%
*-commutative43.9%
associate-*r/43.9%
associate-/r/43.9%
associate-*r/42.6%
associate-/r/42.6%
associate-/l*38.3%
associate-*r/42.6%
Simplified42.6%
Taylor expanded in y around inf 55.7%
unpow255.7%
unpow255.7%
Simplified55.7%
frac-times66.1%
Applied egg-rr66.1%
if 2.8999999999999998e94 < x Initial program 55.4%
associate-*l/65.1%
*-commutative65.1%
fma-def65.1%
Simplified65.1%
fma-udef65.1%
associate-*r/55.4%
frac-times78.6%
frac-times99.6%
+-commutative99.6%
frac-times78.6%
clear-num78.6%
frac-times55.4%
associate-/l*65.0%
frac-add23.9%
*-un-lft-identity23.9%
associate-/l*24.0%
times-frac26.4%
times-frac48.0%
associate-/l*59.6%
Applied egg-rr59.6%
associate-/l*52.8%
associate-*r/59.5%
*-commutative59.5%
associate-*r/57.1%
associate-/r/57.1%
associate-*r/54.9%
associate-/r/55.0%
associate-/l*45.6%
associate-*r/55.1%
Simplified55.1%
Taylor expanded in y around inf 32.6%
unpow232.6%
unpow232.6%
Simplified32.6%
associate-/l*40.1%
div-inv40.1%
associate-/l*33.5%
Applied egg-rr33.5%
associate-/r/33.4%
associate-*l/40.1%
associate-/r/40.1%
Applied egg-rr40.1%
Final simplification61.8%
(FPCore (x y z t) :precision binary64 (if (<= x 5e+93) (* (/ z t) (/ z t)) (* z (/ z (* t t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 5e+93) {
tmp = (z / t) * (z / t);
} 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 (x <= 5d+93) then
tmp = (z / t) * (z / t)
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 (x <= 5e+93) {
tmp = (z / t) * (z / t);
} else {
tmp = z * (z / (t * t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 5e+93: tmp = (z / t) * (z / t) else: tmp = z * (z / (t * t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 5e+93) tmp = Float64(Float64(z / t) * Float64(z / t)); 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 (x <= 5e+93) tmp = (z / t) * (z / t); else tmp = z * (z / (t * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 5e+93], N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(z * N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+93}:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{z}{t \cdot t}\\
\end{array}
\end{array}
if x < 5.0000000000000001e93Initial program 71.8%
associate-*l/79.7%
*-commutative79.7%
fma-def79.7%
Simplified79.7%
fma-udef79.7%
associate-*r/71.8%
frac-times83.3%
frac-times99.7%
+-commutative99.7%
frac-times83.3%
clear-num83.2%
frac-times71.8%
associate-/l*79.7%
frac-add27.8%
*-un-lft-identity27.8%
associate-/l*29.7%
times-frac30.6%
times-frac39.7%
associate-/l*44.0%
Applied egg-rr44.0%
associate-/l*39.6%
associate-*r/43.9%
*-commutative43.9%
associate-*r/43.9%
associate-/r/43.9%
associate-*r/42.6%
associate-/r/42.6%
associate-/l*38.3%
associate-*r/42.6%
Simplified42.6%
Taylor expanded in y around inf 55.7%
unpow255.7%
unpow255.7%
Simplified55.7%
frac-times66.1%
Applied egg-rr66.1%
if 5.0000000000000001e93 < x Initial program 55.4%
associate-*l/65.1%
*-commutative65.1%
fma-def65.1%
Simplified65.1%
fma-udef65.1%
associate-*r/55.4%
frac-times78.6%
frac-times99.6%
+-commutative99.6%
frac-times78.6%
clear-num78.6%
frac-times55.4%
associate-/l*65.0%
frac-add23.9%
*-un-lft-identity23.9%
associate-/l*24.0%
times-frac26.4%
times-frac48.0%
associate-/l*59.6%
Applied egg-rr59.6%
associate-/l*52.8%
associate-*r/59.5%
*-commutative59.5%
associate-*r/57.1%
associate-/r/57.1%
associate-*r/54.9%
associate-/r/55.0%
associate-/l*45.6%
associate-*r/55.1%
Simplified55.1%
Taylor expanded in y around inf 32.6%
unpow232.6%
unpow232.6%
Simplified32.6%
associate-/l*40.1%
associate-/r/40.1%
Applied egg-rr40.1%
Final simplification61.8%
(FPCore (x y z t) :precision binary64 (* (/ z t) (/ z t)))
double code(double x, double y, double z, double t) {
return (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 = (z / t) * (z / t)
end function
public static double code(double x, double y, double z, double t) {
return (z / t) * (z / t);
}
def code(x, y, z, t): return (z / t) * (z / t)
function code(x, y, z, t) return Float64(Float64(z / t) * Float64(z / t)) end
function tmp = code(x, y, z, t) tmp = (z / t) * (z / t); end
code[x_, y_, z_, t_] := N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z}{t} \cdot \frac{z}{t}
\end{array}
Initial program 69.1%
associate-*l/77.3%
*-commutative77.3%
fma-def77.3%
Simplified77.3%
fma-udef77.3%
associate-*r/69.1%
frac-times82.5%
frac-times99.7%
+-commutative99.7%
frac-times82.5%
clear-num82.5%
frac-times69.1%
associate-/l*77.3%
frac-add27.2%
*-un-lft-identity27.2%
associate-/l*28.8%
times-frac30.0%
times-frac41.0%
associate-/l*46.5%
Applied egg-rr46.5%
associate-/l*41.8%
associate-*r/46.5%
*-commutative46.5%
associate-*r/46.1%
associate-/r/46.1%
associate-*r/44.6%
associate-/r/44.6%
associate-/l*39.5%
associate-*r/44.6%
Simplified44.6%
Taylor expanded in y around inf 51.9%
unpow251.9%
unpow251.9%
Simplified51.9%
frac-times60.7%
Applied egg-rr60.7%
Final simplification60.7%
(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 2023279
(FPCore (x y z t)
:name "Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1"
:precision binary64
:herbie-target
(+ (pow (/ x y) 2.0) (pow (/ z t) 2.0))
(+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))