
(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 17 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 (/ 1.0 (/ 1.0 (+ (pow (/ x y) 2.0) (pow (/ z t) 2.0)))))
double code(double x, double y, double z, double t) {
return 1.0 / (1.0 / (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 = 1.0d0 / (1.0d0 / (((x / y) ** 2.0d0) + ((z / t) ** 2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 / (1.0 / (Math.pow((x / y), 2.0) + Math.pow((z / t), 2.0)));
}
def code(x, y, z, t): return 1.0 / (1.0 / (math.pow((x / y), 2.0) + math.pow((z / t), 2.0)))
function code(x, y, z, t) return Float64(1.0 / Float64(1.0 / Float64((Float64(x / y) ^ 2.0) + (Float64(z / t) ^ 2.0)))) end
function tmp = code(x, y, z, t) tmp = 1.0 / (1.0 / (((x / y) ^ 2.0) + ((z / t) ^ 2.0))); end
code[x_, y_, z_, t_] := N[(1.0 / N[(1.0 / N[(N[Power[N[(x / y), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(z / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{1}{{\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}}}
\end{array}
Initial program 64.8%
lift-+.f64N/A
flip-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip-+N/A
lift-+.f64N/A
lower-/.f6464.7
Applied rewrites99.6%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (<= t 7e-243) (+ (/ (* (/ z t) z) t) (/ (* (/ x y) x) y)) (fma z (* (pow t -1.0) (/ z t)) (pow (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 7e-243) {
tmp = (((z / t) * z) / t) + (((x / y) * x) / y);
} else {
tmp = fma(z, (pow(t, -1.0) * (z / t)), pow((x / y), 2.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 7e-243) tmp = Float64(Float64(Float64(Float64(z / t) * z) / t) + Float64(Float64(Float64(x / y) * x) / y)); else tmp = fma(z, Float64((t ^ -1.0) * Float64(z / t)), (Float64(x / y) ^ 2.0)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 7e-243], N[(N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision] + N[(N[(N[(x / y), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[Power[t, -1.0], $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision] + N[Power[N[(x / y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7 \cdot 10^{-243}:\\
\;\;\;\;\frac{\frac{z}{t} \cdot z}{t} + \frac{\frac{x}{y} \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, {t}^{-1} \cdot \frac{z}{t}, {\left(\frac{x}{y}\right)}^{2}\right)\\
\end{array}
\end{array}
if t < 6.99999999999999958e-243Initial program 59.9%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6476.5
Applied rewrites76.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6495.3
Applied rewrites95.3%
if 6.99999999999999958e-243 < t Initial program 71.4%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-/.f6484.0
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Final simplification97.2%
(FPCore (x y z t) :precision binary64 (fma (/ -1.0 t) (* (/ (- z) t) z) (pow (/ x y) 2.0)))
double code(double x, double y, double z, double t) {
return fma((-1.0 / t), ((-z / t) * z), pow((x / y), 2.0));
}
function code(x, y, z, t) return fma(Float64(-1.0 / t), Float64(Float64(Float64(-z) / t) * z), (Float64(x / y) ^ 2.0)) end
code[x_, y_, z_, t_] := N[(N[(-1.0 / t), $MachinePrecision] * N[(N[((-z) / t), $MachinePrecision] * z), $MachinePrecision] + N[Power[N[(x / y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{-1}{t}, \frac{-z}{t} \cdot z, {\left(\frac{x}{y}\right)}^{2}\right)
\end{array}
Initial program 64.8%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
frac-2negN/A
neg-mul-1N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
times-fracN/A
distribute-neg-frac2N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f6477.5
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6496.4
Applied rewrites96.4%
Final simplification96.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x x) (* y y))))
(if (<= t_1 1e-231)
(/ (/ z t) (/ t z))
(if (<= t_1 2e+255)
(+ (* (/ z (* t t)) z) t_1)
(if (<= t_1 INFINITY)
(/ (/ x y) (/ y x))
(* (/ (- z) t) (* (/ -1.0 t) z)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * x) / (y * y);
double tmp;
if (t_1 <= 1e-231) {
tmp = (z / t) / (t / z);
} else if (t_1 <= 2e+255) {
tmp = ((z / (t * t)) * z) + t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (x / y) / (y / x);
} else {
tmp = (-z / t) * ((-1.0 / t) * z);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x * x) / (y * y);
double tmp;
if (t_1 <= 1e-231) {
tmp = (z / t) / (t / z);
} else if (t_1 <= 2e+255) {
tmp = ((z / (t * t)) * z) + t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (x / y) / (y / x);
} else {
tmp = (-z / t) * ((-1.0 / t) * z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * x) / (y * y) tmp = 0 if t_1 <= 1e-231: tmp = (z / t) / (t / z) elif t_1 <= 2e+255: tmp = ((z / (t * t)) * z) + t_1 elif t_1 <= math.inf: tmp = (x / y) / (y / x) else: tmp = (-z / t) * ((-1.0 / t) * z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * x) / Float64(y * y)) tmp = 0.0 if (t_1 <= 1e-231) tmp = Float64(Float64(z / t) / Float64(t / z)); elseif (t_1 <= 2e+255) tmp = Float64(Float64(Float64(z / Float64(t * t)) * z) + t_1); elseif (t_1 <= Inf) tmp = Float64(Float64(x / y) / Float64(y / x)); else tmp = Float64(Float64(Float64(-z) / t) * Float64(Float64(-1.0 / t) * z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * x) / (y * y); tmp = 0.0; if (t_1 <= 1e-231) tmp = (z / t) / (t / z); elseif (t_1 <= 2e+255) tmp = ((z / (t * t)) * z) + t_1; elseif (t_1 <= Inf) tmp = (x / y) / (y / x); else tmp = (-z / t) * ((-1.0 / t) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-231], N[(N[(z / t), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+255], N[(N[(N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(x / y), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[((-z) / t), $MachinePrecision] * N[(N[(-1.0 / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot x}{y \cdot y}\\
\mathbf{if}\;t\_1 \leq 10^{-231}:\\
\;\;\;\;\frac{\frac{z}{t}}{\frac{t}{z}}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+255}:\\
\;\;\;\;\frac{z}{t \cdot t} \cdot z + t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\frac{x}{y}}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-z}{t} \cdot \left(\frac{-1}{t} \cdot z\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < 9.9999999999999999e-232Initial program 68.4%
Taylor expanded in t around 0
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.6
Applied rewrites94.6%
Applied rewrites94.7%
if 9.9999999999999999e-232 < (/.f64 (*.f64 x x) (*.f64 y y)) < 1.99999999999999998e255Initial program 80.2%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
pow2N/A
pow-flipN/A
lower-pow.f64N/A
metadata-eval91.0
Applied rewrites91.0%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
metadata-evalN/A
pow-flipN/A
pow2N/A
div-invN/A
lower-/.f64N/A
lower-*.f6491.4
Applied rewrites91.4%
if 1.99999999999999998e255 < (/.f64 (*.f64 x x) (*.f64 y y)) < +inf.0Initial program 74.3%
Taylor expanded in t around inf
unpow2N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6490.6
Applied rewrites90.6%
Applied rewrites94.8%
if +inf.0 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 0.0%
Taylor expanded in t around 0
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6458.6
Applied rewrites58.6%
Applied rewrites38.6%
Applied rewrites48.2%
Applied rewrites58.8%
Final simplification90.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x x) (* y y))))
(if (<= t_1 2e+255)
(+ (/ (/ z t) (/ t z)) t_1)
(+ (/ (* (/ z t) z) t) (/ (* (/ x y) x) y)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * x) / (y * y);
double tmp;
if (t_1 <= 2e+255) {
tmp = ((z / t) / (t / z)) + t_1;
} else {
tmp = (((z / t) * z) / t) + (((x / y) * x) / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x * x) / (y * y)
if (t_1 <= 2d+255) then
tmp = ((z / t) / (t / z)) + t_1
else
tmp = (((z / t) * z) / t) + (((x / y) * x) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * x) / (y * y);
double tmp;
if (t_1 <= 2e+255) {
tmp = ((z / t) / (t / z)) + t_1;
} else {
tmp = (((z / t) * z) / t) + (((x / y) * x) / y);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * x) / (y * y) tmp = 0 if t_1 <= 2e+255: tmp = ((z / t) / (t / z)) + t_1 else: tmp = (((z / t) * z) / t) + (((x / y) * x) / y) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * x) / Float64(y * y)) tmp = 0.0 if (t_1 <= 2e+255) tmp = Float64(Float64(Float64(z / t) / Float64(t / z)) + t_1); else tmp = Float64(Float64(Float64(Float64(z / t) * z) / t) + Float64(Float64(Float64(x / y) * x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * x) / (y * y); tmp = 0.0; if (t_1 <= 2e+255) tmp = ((z / t) / (t / z)) + t_1; else tmp = (((z / t) * z) / t) + (((x / y) * x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+255], N[(N[(N[(z / t), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision] + N[(N[(N[(x / y), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot x}{y \cdot y}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+255}:\\
\;\;\;\;\frac{\frac{z}{t}}{\frac{t}{z}} + t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{z}{t} \cdot z}{t} + \frac{\frac{x}{y} \cdot x}{y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < 1.99999999999999998e255Initial program 72.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6496.3
Applied rewrites96.3%
if 1.99999999999999998e255 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 56.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6463.0
Applied rewrites63.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6496.6
Applied rewrites96.6%
Final simplification96.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* z z) (* t t))))
(if (<= t_1 INFINITY)
(+ (* (/ x y) (/ x y)) t_1)
(+ (/ (/ z t) (/ t z)) (/ (* x x) (* y y))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * z) / (t * t);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = ((x / y) * (x / y)) + t_1;
} else {
tmp = ((z / t) / (t / z)) + ((x * x) / (y * y));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (z * z) / (t * t);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((x / y) * (x / y)) + t_1;
} else {
tmp = ((z / t) / (t / z)) + ((x * x) / (y * y));
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * z) / (t * t) tmp = 0 if t_1 <= math.inf: tmp = ((x / y) * (x / y)) + t_1 else: tmp = ((z / t) / (t / z)) + ((x * x) / (y * y)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * z) / Float64(t * t)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(Float64(Float64(x / y) * Float64(x / y)) + t_1); else tmp = Float64(Float64(Float64(z / t) / Float64(t / z)) + Float64(Float64(x * x) / Float64(y * y))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * z) / (t * t); tmp = 0.0; if (t_1 <= Inf) tmp = ((x / y) * (x / y)) + t_1; else tmp = ((z / t) / (t / z)) + ((x * x) / (y * y)); 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, Infinity], N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(z / t), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision] + N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot z}{t \cdot t}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{z}{t}}{\frac{t}{z}} + \frac{x \cdot x}{y \cdot y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < +inf.0Initial program 75.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6493.1
Applied rewrites93.1%
if +inf.0 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 0.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6485.5
Applied rewrites85.5%
Final simplification92.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* x x) (* y y))) (t_2 (* (/ z t) (/ z t)))) (if (<= t_1 5e-180) t_2 (if (<= t_1 INFINITY) (* (/ x (* y y)) x) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (x * x) / (y * y);
double t_2 = (z / t) * (z / t);
double tmp;
if (t_1 <= 5e-180) {
tmp = t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (x / (y * y)) * x;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x * x) / (y * y);
double t_2 = (z / t) * (z / t);
double tmp;
if (t_1 <= 5e-180) {
tmp = t_2;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (x / (y * y)) * x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * x) / (y * y) t_2 = (z / t) * (z / t) tmp = 0 if t_1 <= 5e-180: tmp = t_2 elif t_1 <= math.inf: tmp = (x / (y * y)) * x else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * x) / Float64(y * y)) t_2 = Float64(Float64(z / t) * Float64(z / t)) tmp = 0.0 if (t_1 <= 5e-180) tmp = t_2; elseif (t_1 <= Inf) tmp = Float64(Float64(x / Float64(y * y)) * x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * x) / (y * y); t_2 = (z / t) * (z / t); tmp = 0.0; if (t_1 <= 5e-180) tmp = t_2; elseif (t_1 <= Inf) tmp = (x / (y * y)) * x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-180], t$95$2, If[LessEqual[t$95$1, Infinity], N[(N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot x}{y \cdot y}\\
t_2 := \frac{z}{t} \cdot \frac{z}{t}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-180}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{x}{y \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < 5.0000000000000001e-180 or +inf.0 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 52.9%
Taylor expanded in t around 0
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6485.5
Applied rewrites85.5%
if 5.0000000000000001e-180 < (/.f64 (*.f64 x x) (*.f64 y y)) < +inf.0Initial program 75.9%
Taylor expanded in t around inf
unpow2N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6480.6
Applied rewrites80.6%
Applied rewrites80.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* z z) (* t t))))
(if (<= t_1 INFINITY)
(+ (* (/ x y) (/ x y)) t_1)
(+ (/ (* x x) (* y y)) (/ (* (/ z t) z) t)))))
double code(double x, double y, double z, double t) {
double t_1 = (z * z) / (t * t);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = ((x / y) * (x / y)) + t_1;
} else {
tmp = ((x * x) / (y * y)) + (((z / t) * z) / t);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (z * z) / (t * t);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((x / y) * (x / y)) + t_1;
} else {
tmp = ((x * x) / (y * y)) + (((z / t) * z) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * z) / (t * t) tmp = 0 if t_1 <= math.inf: tmp = ((x / y) * (x / y)) + t_1 else: tmp = ((x * x) / (y * y)) + (((z / t) * z) / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * z) / Float64(t * t)) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(Float64(Float64(x / y) * Float64(x / y)) + t_1); else tmp = Float64(Float64(Float64(x * x) / Float64(y * y)) + Float64(Float64(Float64(z / t) * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * z) / (t * t); tmp = 0.0; if (t_1 <= Inf) tmp = ((x / y) * (x / y)) + t_1; else tmp = ((x * x) / (y * y)) + (((z / t) * z) / t); 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, Infinity], N[(N[(N[(x / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot z}{t \cdot t}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot x}{y \cdot y} + \frac{\frac{z}{t} \cdot z}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < +inf.0Initial program 75.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6493.1
Applied rewrites93.1%
if +inf.0 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 0.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6474.9
Applied rewrites74.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* z z) (* t t)))) (if (<= t_1 2e+271) (+ (* (/ x y) (/ x 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 <= 2e+271) {
tmp = ((x / y) * (x / 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 <= 2d+271) then
tmp = ((x / y) * (x / 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 <= 2e+271) {
tmp = ((x / y) * (x / 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 <= 2e+271: tmp = ((x / y) * (x / 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 <= 2e+271) tmp = Float64(Float64(Float64(x / y) * Float64(x / 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 <= 2e+271) tmp = ((x / y) * (x / 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, 2e+271], N[(N[(N[(x / y), $MachinePrecision] * N[(x / 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 2 \cdot 10^{+271}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{x}{y} + t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{z}{t}}{\frac{t}{z}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 1.99999999999999991e271Initial program 72.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.3
Applied rewrites94.3%
if 1.99999999999999991e271 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 55.8%
Taylor expanded in t around 0
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6483.8
Applied rewrites83.8%
Applied rewrites83.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* x x) (* y y))) (t_2 (* (/ z (* t t)) z))) (if (<= t_1 5e-180) t_2 (if (<= t_1 INFINITY) (* (/ x (* y y)) x) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (x * x) / (y * y);
double t_2 = (z / (t * t)) * z;
double tmp;
if (t_1 <= 5e-180) {
tmp = t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (x / (y * y)) * x;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x * x) / (y * y);
double t_2 = (z / (t * t)) * z;
double tmp;
if (t_1 <= 5e-180) {
tmp = t_2;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (x / (y * y)) * x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * x) / (y * y) t_2 = (z / (t * t)) * z tmp = 0 if t_1 <= 5e-180: tmp = t_2 elif t_1 <= math.inf: tmp = (x / (y * y)) * x else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * x) / Float64(y * y)) t_2 = Float64(Float64(z / Float64(t * t)) * z) tmp = 0.0 if (t_1 <= 5e-180) tmp = t_2; elseif (t_1 <= Inf) tmp = Float64(Float64(x / Float64(y * y)) * x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * x) / (y * y); t_2 = (z / (t * t)) * z; tmp = 0.0; if (t_1 <= 5e-180) tmp = t_2; elseif (t_1 <= Inf) tmp = (x / (y * y)) * x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-180], t$95$2, If[LessEqual[t$95$1, Infinity], N[(N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot x}{y \cdot y}\\
t_2 := \frac{z}{t \cdot t} \cdot z\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-180}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{x}{y \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < 5.0000000000000001e-180 or +inf.0 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 52.9%
Taylor expanded in t around 0
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6485.5
Applied rewrites85.5%
Applied rewrites61.2%
Applied rewrites79.4%
Applied rewrites67.2%
if 5.0000000000000001e-180 < (/.f64 (*.f64 x x) (*.f64 y y)) < +inf.0Initial program 75.9%
Taylor expanded in t around inf
unpow2N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6480.6
Applied rewrites80.6%
Applied rewrites80.7%
Final simplification74.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* z z) (* t t))) (t_2 (* (/ x (* y y)) x))) (if (<= t_1 2.2e-76) t_2 (if (<= t_1 INFINITY) t_1 t_2))))
double code(double x, double y, double z, double t) {
double t_1 = (z * z) / (t * t);
double t_2 = (x / (y * y)) * x;
double tmp;
if (t_1 <= 2.2e-76) {
tmp = t_2;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (z * z) / (t * t);
double t_2 = (x / (y * y)) * x;
double tmp;
if (t_1 <= 2.2e-76) {
tmp = t_2;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * z) / (t * t) t_2 = (x / (y * y)) * x tmp = 0 if t_1 <= 2.2e-76: tmp = t_2 elif t_1 <= math.inf: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * z) / Float64(t * t)) t_2 = Float64(Float64(x / Float64(y * y)) * x) tmp = 0.0 if (t_1 <= 2.2e-76) tmp = t_2; elseif (t_1 <= Inf) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * z) / (t * t); t_2 = (x / (y * y)) * x; tmp = 0.0; if (t_1 <= 2.2e-76) tmp = t_2; elseif (t_1 <= Inf) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, 2.2e-76], t$95$2, If[LessEqual[t$95$1, Infinity], t$95$1, t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot z}{t \cdot t}\\
t_2 := \frac{x}{y \cdot y} \cdot x\\
\mathbf{if}\;t\_1 \leq 2.2 \cdot 10^{-76}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 2.19999999999999999e-76 or +inf.0 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 53.5%
Taylor expanded in t around inf
unpow2N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6473.4
Applied rewrites73.4%
Applied rewrites66.2%
if 2.19999999999999999e-76 < (/.f64 (*.f64 z z) (*.f64 t t)) < +inf.0Initial program 80.2%
Taylor expanded in t around 0
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6484.3
Applied rewrites84.3%
Applied rewrites83.4%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 2e-76) (/ (/ 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)) <= 2e-76) {
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)) <= 2d-76) 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)) <= 2e-76) {
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)) <= 2e-76: 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)) <= 2e-76) 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)) <= 2e-76) 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], 2e-76], 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 2 \cdot 10^{-76}:\\
\;\;\;\;\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)) < 1.99999999999999985e-76Initial program 70.1%
Taylor expanded in t around inf
unpow2N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6484.8
Applied rewrites84.8%
Applied rewrites90.7%
if 1.99999999999999985e-76 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 60.6%
Taylor expanded in t around 0
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6480.0
Applied rewrites80.0%
Applied rewrites80.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 5e-50) (/ (/ 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-50) {
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-50) 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-50) {
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-50: 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-50) 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-50) 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-50], 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^{-50}:\\
\;\;\;\;\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.99999999999999968e-50Initial program 71.1%
Taylor expanded in t around inf
unpow2N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6483.7
Applied rewrites83.7%
Applied rewrites89.4%
if 4.99999999999999968e-50 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 59.5%
Taylor expanded in t around 0
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6480.8
Applied rewrites80.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 5e-50) (* (/ 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-50) {
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-50) 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-50) {
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-50: 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-50) 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-50) 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-50], 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^{-50}:\\
\;\;\;\;\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.99999999999999968e-50Initial program 71.1%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
frac-addN/A
lower-/.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f6463.9
Applied rewrites63.9%
Taylor expanded in t around inf
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6489.3
Applied rewrites89.3%
if 4.99999999999999968e-50 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 59.5%
Taylor expanded in t around 0
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6480.8
Applied rewrites80.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 5e-50) (/ 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-50) {
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-50) 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-50) {
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-50: 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-50) tmp = Float64(x / Float64(Float64(y / 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-50) 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-50], N[(x / N[(N[(y / 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^{-50}:\\
\;\;\;\;\frac{x}{\frac{y}{x} \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 4.99999999999999968e-50Initial program 71.1%
Taylor expanded in t around inf
unpow2N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6483.7
Applied rewrites83.7%
Applied rewrites84.6%
if 4.99999999999999968e-50 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 59.5%
Taylor expanded in t around 0
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6480.8
Applied rewrites80.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ (* z z) (* t t)) 2e-76) (* (/ (/ 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-76) {
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-76) 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-76) {
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-76: 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-76) tmp = Float64(Float64(Float64(x / y) / 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-76) 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-76], N[(N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision] * x), $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^{-76}:\\
\;\;\;\;\frac{\frac{x}{y}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{t} \cdot \frac{z}{t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 1.99999999999999985e-76Initial program 70.1%
Taylor expanded in t around inf
unpow2N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6484.8
Applied rewrites84.8%
if 1.99999999999999985e-76 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 60.6%
Taylor expanded in t around 0
unpow2N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6480.0
Applied rewrites80.0%
(FPCore (x y z t) :precision binary64 (* (/ x (* y y)) x))
double code(double x, double y, double z, double t) {
return (x / (y * y)) * x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return (x / (y * y)) * x;
}
def code(x, y, z, t): return (x / (y * y)) * x
function code(x, y, z, t) return Float64(Float64(x / Float64(y * y)) * x) end
function tmp = code(x, y, z, t) tmp = (x / (y * y)) * x; end
code[x_, y_, z_, t_] := N[(N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y \cdot y} \cdot x
\end{array}
Initial program 64.8%
Taylor expanded in t around inf
unpow2N/A
associate-*l/N/A
lower-*.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6455.9
Applied rewrites55.9%
Applied rewrites54.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 2024255
(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))))