
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x / y) + ((2.0d0 + ((z * 2.0d0) * (1.0d0 - t))) / (t * z))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z));
}
def code(x, y, z, t): return (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(Float64(z * 2.0) * Float64(1.0 - t))) / Float64(t * z))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 + ((z * 2.0) * (1.0 - t))) / (t * z)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(N[(z * 2.0), $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \frac{2 + \left(z \cdot 2\right) \cdot \left(1 - t\right)}{t \cdot z}
\end{array}
(FPCore (x y z t) :precision binary64 (+ (/ x y) (+ (/ 2.0 t) (- (/ (/ 2.0 z) t) 2.0))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 / t) + (((2.0 / 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 / t) + (((2.0d0 / z) / t) - 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 / t) + (((2.0 / z) / t) - 2.0));
}
def code(x, y, z, t): return (x / y) + ((2.0 / t) + (((2.0 / z) / t) - 2.0))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 / t) + Float64(Float64(Float64(2.0 / z) / t) - 2.0))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 / t) + (((2.0 / z) / t) - 2.0)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + N[(N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2}{t} + \left(\frac{\frac{2}{z}}{t} - 2\right)\right)
\end{array}
Initial program 84.3%
Taylor expanded in t around 0 98.0%
metadata-eval98.0%
associate-*r/98.0%
+-commutative98.0%
associate-*r/98.0%
metadata-eval98.0%
associate--l+98.0%
associate-*r/98.0%
metadata-eval98.0%
associate-/l/98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (+ 2.0 (/ 2.0 z)) (/ 1.0 t))) (t_2 (- (/ x y) 2.0)))
(if (<= t -4.8e-44)
t_2
(if (<= t 1.8e-56)
t_1
(if (<= t 4.7e-24) (/ x y) (if (<= t 1080000000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) * (1.0 / t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -4.8e-44) {
tmp = t_2;
} else if (t <= 1.8e-56) {
tmp = t_1;
} else if (t <= 4.7e-24) {
tmp = x / y;
} else if (t <= 1080000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (2.0d0 + (2.0d0 / z)) * (1.0d0 / t)
t_2 = (x / y) - 2.0d0
if (t <= (-4.8d-44)) then
tmp = t_2
else if (t <= 1.8d-56) then
tmp = t_1
else if (t <= 4.7d-24) then
tmp = x / y
else if (t <= 1080000000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) * (1.0 / t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -4.8e-44) {
tmp = t_2;
} else if (t <= 1.8e-56) {
tmp = t_1;
} else if (t <= 4.7e-24) {
tmp = x / y;
} else if (t <= 1080000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + (2.0 / z)) * (1.0 / t) t_2 = (x / y) - 2.0 tmp = 0 if t <= -4.8e-44: tmp = t_2 elif t <= 1.8e-56: tmp = t_1 elif t <= 4.7e-24: tmp = x / y elif t <= 1080000000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(2.0 / z)) * Float64(1.0 / t)) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -4.8e-44) tmp = t_2; elseif (t <= 1.8e-56) tmp = t_1; elseif (t <= 4.7e-24) tmp = Float64(x / y); elseif (t <= 1080000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 + (2.0 / z)) * (1.0 / t); t_2 = (x / y) - 2.0; tmp = 0.0; if (t <= -4.8e-44) tmp = t_2; elseif (t <= 1.8e-56) tmp = t_1; elseif (t <= 4.7e-24) tmp = x / y; elseif (t <= 1080000000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -4.8e-44], t$95$2, If[LessEqual[t, 1.8e-56], t$95$1, If[LessEqual[t, 4.7e-24], N[(x / y), $MachinePrecision], If[LessEqual[t, 1080000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(2 + \frac{2}{z}\right) \cdot \frac{1}{t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{-44}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.7 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;t \leq 1080000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -4.80000000000000017e-44 or 1.08e12 < t Initial program 73.4%
Taylor expanded in t around inf 88.7%
if -4.80000000000000017e-44 < t < 1.79999999999999989e-56 or 4.69999999999999992e-24 < t < 1.08e12Initial program 95.6%
Taylor expanded in t around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
Simplified83.1%
div-inv83.2%
Applied egg-rr83.2%
if 1.79999999999999989e-56 < t < 4.69999999999999992e-24Initial program 100.0%
Taylor expanded in x around inf 100.0%
Final simplification86.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -6e-44)
t_1
(if (<= t 9e-57)
(+ (/ 2.0 t) (/ (/ 2.0 t) z))
(if (<= t 2.4e-22)
(/ x y)
(if (<= t 1080000000000.0) (* (+ 2.0 (/ 2.0 z)) (/ 1.0 t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -6e-44) {
tmp = t_1;
} else if (t <= 9e-57) {
tmp = (2.0 / t) + ((2.0 / t) / z);
} else if (t <= 2.4e-22) {
tmp = x / y;
} else if (t <= 1080000000000.0) {
tmp = (2.0 + (2.0 / z)) * (1.0 / t);
} else {
tmp = t_1;
}
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 / y) - 2.0d0
if (t <= (-6d-44)) then
tmp = t_1
else if (t <= 9d-57) then
tmp = (2.0d0 / t) + ((2.0d0 / t) / z)
else if (t <= 2.4d-22) then
tmp = x / y
else if (t <= 1080000000000.0d0) then
tmp = (2.0d0 + (2.0d0 / z)) * (1.0d0 / t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -6e-44) {
tmp = t_1;
} else if (t <= 9e-57) {
tmp = (2.0 / t) + ((2.0 / t) / z);
} else if (t <= 2.4e-22) {
tmp = x / y;
} else if (t <= 1080000000000.0) {
tmp = (2.0 + (2.0 / z)) * (1.0 / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -6e-44: tmp = t_1 elif t <= 9e-57: tmp = (2.0 / t) + ((2.0 / t) / z) elif t <= 2.4e-22: tmp = x / y elif t <= 1080000000000.0: tmp = (2.0 + (2.0 / z)) * (1.0 / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -6e-44) tmp = t_1; elseif (t <= 9e-57) tmp = Float64(Float64(2.0 / t) + Float64(Float64(2.0 / t) / z)); elseif (t <= 2.4e-22) tmp = Float64(x / y); elseif (t <= 1080000000000.0) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) * Float64(1.0 / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -6e-44) tmp = t_1; elseif (t <= 9e-57) tmp = (2.0 / t) + ((2.0 / t) / z); elseif (t <= 2.4e-22) tmp = x / y; elseif (t <= 1080000000000.0) tmp = (2.0 + (2.0 / z)) * (1.0 / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -6e-44], t$95$1, If[LessEqual[t, 9e-57], N[(N[(2.0 / t), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-22], N[(x / y), $MachinePrecision], If[LessEqual[t, 1080000000000.0], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -6 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-57}:\\
\;\;\;\;\frac{2}{t} + \frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-22}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;t \leq 1080000000000:\\
\;\;\;\;\left(2 + \frac{2}{z}\right) \cdot \frac{1}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -6.0000000000000005e-44 or 1.08e12 < t Initial program 73.4%
Taylor expanded in t around inf 88.7%
if -6.0000000000000005e-44 < t < 8.99999999999999945e-57Initial program 95.4%
Taylor expanded in t around 0 95.4%
Taylor expanded in x around 0 95.6%
associate-*r/95.6%
metadata-eval95.6%
associate-+r+95.6%
associate-*r/95.6%
metadata-eval95.6%
associate-/r*95.6%
+-commutative95.6%
associate-+r+95.6%
+-commutative95.6%
+-commutative95.6%
associate-+l+95.6%
metadata-eval95.6%
associate-*r/95.6%
associate-/r*95.6%
metadata-eval95.6%
associate-*r/95.6%
associate-/r*95.6%
associate-*r/95.6%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in x around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
associate-*r/83.1%
metadata-eval83.1%
associate-/r*83.1%
Simplified83.1%
if 8.99999999999999945e-57 < t < 2.40000000000000002e-22Initial program 100.0%
Taylor expanded in x around inf 100.0%
if 2.40000000000000002e-22 < t < 1.08e12Initial program 99.7%
Taylor expanded in t around 0 85.6%
associate-*r/85.6%
metadata-eval85.6%
Simplified85.6%
div-inv85.9%
Applied egg-rr85.9%
Final simplification86.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (/ 2.0 z)) t)) (t_2 (- (/ x y) 2.0)))
(if (<= t -2.5e-45)
t_2
(if (<= t 1.82e-56)
t_1
(if (<= t 1e-21) (/ x y) (if (<= t 1080000000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -2.5e-45) {
tmp = t_2;
} else if (t <= 1.82e-56) {
tmp = t_1;
} else if (t <= 1e-21) {
tmp = x / y;
} else if (t <= 1080000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (2.0d0 + (2.0d0 / z)) / t
t_2 = (x / y) - 2.0d0
if (t <= (-2.5d-45)) then
tmp = t_2
else if (t <= 1.82d-56) then
tmp = t_1
else if (t <= 1d-21) then
tmp = x / y
else if (t <= 1080000000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (2.0 + (2.0 / z)) / t;
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -2.5e-45) {
tmp = t_2;
} else if (t <= 1.82e-56) {
tmp = t_1;
} else if (t <= 1e-21) {
tmp = x / y;
} else if (t <= 1080000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 + (2.0 / z)) / t t_2 = (x / y) - 2.0 tmp = 0 if t <= -2.5e-45: tmp = t_2 elif t <= 1.82e-56: tmp = t_1 elif t <= 1e-21: tmp = x / y elif t <= 1080000000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 + Float64(2.0 / z)) / t) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -2.5e-45) tmp = t_2; elseif (t <= 1.82e-56) tmp = t_1; elseif (t <= 1e-21) tmp = Float64(x / y); elseif (t <= 1080000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 + (2.0 / z)) / t; t_2 = (x / y) - 2.0; tmp = 0.0; if (t <= -2.5e-45) tmp = t_2; elseif (t <= 1.82e-56) tmp = t_1; elseif (t <= 1e-21) tmp = x / y; elseif (t <= 1080000000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -2.5e-45], t$95$2, If[LessEqual[t, 1.82e-56], t$95$1, If[LessEqual[t, 1e-21], N[(x / y), $MachinePrecision], If[LessEqual[t, 1080000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2 + \frac{2}{z}}{t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{-45}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.82 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 10^{-21}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;t \leq 1080000000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.49999999999999988e-45 or 1.08e12 < t Initial program 73.4%
Taylor expanded in t around inf 88.7%
if -2.49999999999999988e-45 < t < 1.82000000000000007e-56 or 9.99999999999999908e-22 < t < 1.08e12Initial program 95.6%
Taylor expanded in t around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
Simplified83.1%
if 1.82000000000000007e-56 < t < 9.99999999999999908e-22Initial program 100.0%
Taylor expanded in x around inf 100.0%
Final simplification86.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -1.85e-45)
t_1
(if (<= t -7.6e-245)
(/ (/ 2.0 t) z)
(if (<= t 1.92e-84)
(+ (/ x y) (/ 2.0 t))
(if (<= t 1.05e-56) (/ 2.0 (* t z)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -1.85e-45) {
tmp = t_1;
} else if (t <= -7.6e-245) {
tmp = (2.0 / t) / z;
} else if (t <= 1.92e-84) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 1.05e-56) {
tmp = 2.0 / (t * z);
} else {
tmp = t_1;
}
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 / y) - 2.0d0
if (t <= (-1.85d-45)) then
tmp = t_1
else if (t <= (-7.6d-245)) then
tmp = (2.0d0 / t) / z
else if (t <= 1.92d-84) then
tmp = (x / y) + (2.0d0 / t)
else if (t <= 1.05d-56) then
tmp = 2.0d0 / (t * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -1.85e-45) {
tmp = t_1;
} else if (t <= -7.6e-245) {
tmp = (2.0 / t) / z;
} else if (t <= 1.92e-84) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 1.05e-56) {
tmp = 2.0 / (t * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -1.85e-45: tmp = t_1 elif t <= -7.6e-245: tmp = (2.0 / t) / z elif t <= 1.92e-84: tmp = (x / y) + (2.0 / t) elif t <= 1.05e-56: tmp = 2.0 / (t * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -1.85e-45) tmp = t_1; elseif (t <= -7.6e-245) tmp = Float64(Float64(2.0 / t) / z); elseif (t <= 1.92e-84) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (t <= 1.05e-56) tmp = Float64(2.0 / Float64(t * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -1.85e-45) tmp = t_1; elseif (t <= -7.6e-245) tmp = (2.0 / t) / z; elseif (t <= 1.92e-84) tmp = (x / y) + (2.0 / t); elseif (t <= 1.05e-56) tmp = 2.0 / (t * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -1.85e-45], t$95$1, If[LessEqual[t, -7.6e-245], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 1.92e-84], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e-56], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1.85 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7.6 \cdot 10^{-245}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq 1.92 \cdot 10^{-84}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-56}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.85e-45 or 1.05000000000000003e-56 < t Initial program 75.3%
Taylor expanded in t around inf 86.0%
if -1.85e-45 < t < -7.6000000000000001e-245Initial program 97.5%
Taylor expanded in t around 0 97.7%
metadata-eval97.7%
associate-*r/97.7%
+-commutative97.7%
associate-*r/97.7%
metadata-eval97.7%
associate--l+97.7%
associate-*r/97.7%
metadata-eval97.7%
associate-/l/97.7%
Simplified97.7%
Taylor expanded in z around 0 60.6%
associate-/r*60.6%
Simplified60.6%
if -7.6000000000000001e-245 < t < 1.92e-84Initial program 93.5%
Taylor expanded in t around 0 93.5%
Taylor expanded in z around inf 68.1%
associate-*r/68.1%
metadata-eval68.1%
+-commutative68.1%
Simplified68.1%
if 1.92e-84 < t < 1.05000000000000003e-56Initial program 99.8%
Taylor expanded in t around 0 100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-/l/99.3%
Simplified99.3%
Taylor expanded in z around 0 84.6%
Final simplification77.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -32000.0) (not (<= (/ x y) 3.8e-11))) (+ (/ x y) (/ (+ 2.0 (/ 2.0 z)) t)) (+ (/ 2.0 t) (+ (/ (/ 2.0 z) t) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -32000.0) || !((x / y) <= 3.8e-11)) {
tmp = (x / y) + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (2.0 / t) + (((2.0 / z) / t) + -2.0);
}
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 / y) <= (-32000.0d0)) .or. (.not. ((x / y) <= 3.8d-11))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 / z)) / t)
else
tmp = (2.0d0 / t) + (((2.0d0 / z) / t) + (-2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -32000.0) || !((x / y) <= 3.8e-11)) {
tmp = (x / y) + ((2.0 + (2.0 / z)) / t);
} else {
tmp = (2.0 / t) + (((2.0 / z) / t) + -2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -32000.0) or not ((x / y) <= 3.8e-11): tmp = (x / y) + ((2.0 + (2.0 / z)) / t) else: tmp = (2.0 / t) + (((2.0 / z) / t) + -2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -32000.0) || !(Float64(x / y) <= 3.8e-11)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 / z)) / t)); else tmp = Float64(Float64(2.0 / t) + Float64(Float64(Float64(2.0 / z) / t) + -2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -32000.0) || ~(((x / y) <= 3.8e-11))) tmp = (x / y) + ((2.0 + (2.0 / z)) / t); else tmp = (2.0 / t) + (((2.0 / z) / t) + -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -32000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 3.8e-11]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + N[(N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -32000 \lor \neg \left(\frac{x}{y} \leq 3.8 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + \left(\frac{\frac{2}{z}}{t} + -2\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -32000 or 3.7999999999999998e-11 < (/.f64 x y) Initial program 84.9%
Taylor expanded in t around 0 96.4%
Taylor expanded in x around 0 96.5%
associate-*r/96.5%
metadata-eval96.5%
associate-+r+96.5%
associate-*r/96.5%
metadata-eval96.5%
associate-/r*96.5%
+-commutative96.5%
associate-+r+96.5%
+-commutative96.5%
+-commutative96.5%
associate-+l+96.5%
metadata-eval96.5%
associate-*r/96.5%
associate-/r*96.5%
metadata-eval96.5%
associate-*r/96.5%
associate-/r*96.5%
associate-*r/96.5%
associate-*l/96.5%
Simplified96.4%
if -32000 < (/.f64 x y) < 3.7999999999999998e-11Initial program 83.5%
Taylor expanded in t around 0 99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in x around 0 99.7%
associate-*r/99.7%
metadata-eval99.7%
sub-neg99.7%
associate-*r/99.7%
metadata-eval99.7%
associate-/r*99.8%
metadata-eval99.8%
associate-+r+99.8%
+-commutative99.8%
*-rgt-identity99.8%
associate-*r/99.7%
associate-*l/99.7%
associate-*r/99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification97.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -1.9e-45)
t_1
(if (<= t -7.5e-294) (/ 2.0 (* t z)) (if (<= t 1e-145) (/ 2.0 t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -1.9e-45) {
tmp = t_1;
} else if (t <= -7.5e-294) {
tmp = 2.0 / (t * z);
} else if (t <= 1e-145) {
tmp = 2.0 / t;
} else {
tmp = t_1;
}
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 / y) - 2.0d0
if (t <= (-1.9d-45)) then
tmp = t_1
else if (t <= (-7.5d-294)) then
tmp = 2.0d0 / (t * z)
else if (t <= 1d-145) then
tmp = 2.0d0 / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -1.9e-45) {
tmp = t_1;
} else if (t <= -7.5e-294) {
tmp = 2.0 / (t * z);
} else if (t <= 1e-145) {
tmp = 2.0 / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -1.9e-45: tmp = t_1 elif t <= -7.5e-294: tmp = 2.0 / (t * z) elif t <= 1e-145: tmp = 2.0 / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -1.9e-45) tmp = t_1; elseif (t <= -7.5e-294) tmp = Float64(2.0 / Float64(t * z)); elseif (t <= 1e-145) tmp = Float64(2.0 / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -1.9e-45) tmp = t_1; elseif (t <= -7.5e-294) tmp = 2.0 / (t * z); elseif (t <= 1e-145) tmp = 2.0 / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -1.9e-45], t$95$1, If[LessEqual[t, -7.5e-294], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-145], N[(2.0 / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-294}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;t \leq 10^{-145}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.89999999999999999e-45 or 9.99999999999999915e-146 < t Initial program 78.8%
Taylor expanded in t around inf 79.2%
if -1.89999999999999999e-45 < t < -7.5000000000000004e-294Initial program 96.5%
Taylor expanded in t around 0 96.6%
metadata-eval96.6%
associate-*r/96.6%
+-commutative96.6%
associate-*r/96.6%
metadata-eval96.6%
associate--l+96.6%
associate-*r/96.6%
metadata-eval96.6%
associate-/l/96.6%
Simplified96.6%
Taylor expanded in z around 0 57.9%
if -7.5000000000000004e-294 < t < 9.99999999999999915e-146Initial program 90.1%
Taylor expanded in t around 0 84.3%
associate-*r/84.3%
metadata-eval84.3%
Simplified84.3%
Taylor expanded in z around inf 60.0%
Final simplification72.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -4.4e-45)
t_1
(if (<= t -9e-294) (/ (/ 2.0 t) z) (if (<= t 2.9e-150) (/ 2.0 t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -4.4e-45) {
tmp = t_1;
} else if (t <= -9e-294) {
tmp = (2.0 / t) / z;
} else if (t <= 2.9e-150) {
tmp = 2.0 / t;
} else {
tmp = t_1;
}
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 / y) - 2.0d0
if (t <= (-4.4d-45)) then
tmp = t_1
else if (t <= (-9d-294)) then
tmp = (2.0d0 / t) / z
else if (t <= 2.9d-150) then
tmp = 2.0d0 / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x / y) - 2.0;
double tmp;
if (t <= -4.4e-45) {
tmp = t_1;
} else if (t <= -9e-294) {
tmp = (2.0 / t) / z;
} else if (t <= 2.9e-150) {
tmp = 2.0 / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) - 2.0 tmp = 0 if t <= -4.4e-45: tmp = t_1 elif t <= -9e-294: tmp = (2.0 / t) / z elif t <= 2.9e-150: tmp = 2.0 / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -4.4e-45) tmp = t_1; elseif (t <= -9e-294) tmp = Float64(Float64(2.0 / t) / z); elseif (t <= 2.9e-150) tmp = Float64(2.0 / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) - 2.0; tmp = 0.0; if (t <= -4.4e-45) tmp = t_1; elseif (t <= -9e-294) tmp = (2.0 / t) / z; elseif (t <= 2.9e-150) tmp = 2.0 / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -4.4e-45], t$95$1, If[LessEqual[t, -9e-294], N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 2.9e-150], N[(2.0 / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-294}:\\
\;\;\;\;\frac{\frac{2}{t}}{z}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-150}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.39999999999999987e-45 or 2.8999999999999998e-150 < t Initial program 78.8%
Taylor expanded in t around inf 79.2%
if -4.39999999999999987e-45 < t < -8.99999999999999963e-294Initial program 96.5%
Taylor expanded in t around 0 96.6%
metadata-eval96.6%
associate-*r/96.6%
+-commutative96.6%
associate-*r/96.6%
metadata-eval96.6%
associate--l+96.6%
associate-*r/96.6%
metadata-eval96.6%
associate-/l/96.6%
Simplified96.6%
Taylor expanded in z around 0 57.9%
associate-/r*57.9%
Simplified57.9%
if -8.99999999999999963e-294 < t < 2.8999999999999998e-150Initial program 90.1%
Taylor expanded in t around 0 84.3%
associate-*r/84.3%
metadata-eval84.3%
Simplified84.3%
Taylor expanded in z around inf 60.0%
Final simplification72.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3500000000.0) (not (<= (/ x y) 9500000.0))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3500000000.0) || !((x / y) <= 9500000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
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 / y) <= (-3500000000.0d0)) .or. (.not. ((x / y) <= 9500000.0d0))) then
tmp = x / y
else
tmp = (2.0d0 / t) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3500000000.0) || !((x / y) <= 9500000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -3500000000.0) or not ((x / y) <= 9500000.0): tmp = x / y else: tmp = (2.0 / t) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -3500000000.0) || !(Float64(x / y) <= 9500000.0)) tmp = Float64(x / y); else tmp = Float64(Float64(2.0 / t) + -2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -3500000000.0) || ~(((x / y) <= 9500000.0))) tmp = x / y; else tmp = (2.0 / t) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -3500000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 9500000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3500000000 \lor \neg \left(\frac{x}{y} \leq 9500000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -3.5e9 or 9.5e6 < (/.f64 x y) Initial program 84.5%
Taylor expanded in x around inf 71.4%
if -3.5e9 < (/.f64 x y) < 9.5e6Initial program 83.9%
Taylor expanded in t around 0 99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in z around inf 63.4%
sub-neg63.4%
associate-*r/63.4%
metadata-eval63.4%
+-commutative63.4%
metadata-eval63.4%
associate-+l+63.4%
Simplified63.4%
Taylor expanded in x around 0 63.2%
sub-neg63.2%
associate-*r/63.2%
metadata-eval63.2%
metadata-eval63.2%
Simplified63.2%
Final simplification67.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.5e-45) (not (<= t 4.85e-57))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ 2.0 t) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.5e-45) || !(t <= 4.85e-57)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (2.0 / t) + ((2.0 / 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 ((t <= (-4.5d-45)) .or. (.not. (t <= 4.85d-57))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (2.0d0 / t) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.5e-45) || !(t <= 4.85e-57)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (2.0 / t) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.5e-45) or not (t <= 4.85e-57): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (2.0 / t) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.5e-45) || !(t <= 4.85e-57)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(2.0 / t) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.5e-45) || ~((t <= 4.85e-57))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (2.0 / t) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.5e-45], N[Not[LessEqual[t, 4.85e-57]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{-45} \lor \neg \left(t \leq 4.85 \cdot 10^{-57}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if t < -4.4999999999999999e-45 or 4.85e-57 < t Initial program 75.3%
Taylor expanded in t around 0 99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in z around inf 87.7%
sub-neg87.7%
associate-*r/87.7%
metadata-eval87.7%
+-commutative87.7%
metadata-eval87.7%
associate-+l+87.7%
Simplified87.7%
if -4.4999999999999999e-45 < t < 4.85e-57Initial program 95.4%
Taylor expanded in t around 0 95.4%
Taylor expanded in x around 0 95.6%
associate-*r/95.6%
metadata-eval95.6%
associate-+r+95.6%
associate-*r/95.6%
metadata-eval95.6%
associate-/r*95.6%
+-commutative95.6%
associate-+r+95.6%
+-commutative95.6%
+-commutative95.6%
associate-+l+95.6%
metadata-eval95.6%
associate-*r/95.6%
associate-/r*95.6%
metadata-eval95.6%
associate-*r/95.6%
associate-/r*95.6%
associate-*r/95.6%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in x around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
associate-*r/83.1%
metadata-eval83.1%
associate-/r*83.1%
Simplified83.1%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.7e-7) (not (<= z 3.6e-10))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ x y) (/ (/ 2.0 t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e-7) || !(z <= 3.6e-10)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + ((2.0 / 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 <= (-1.7d-7)) .or. (.not. (z <= 3.6d-10))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (x / y) + ((2.0d0 / t) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e-7) || !(z <= 3.6e-10)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (x / y) + ((2.0 / t) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.7e-7) or not (z <= 3.6e-10): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (x / y) + ((2.0 / t) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.7e-7) || !(z <= 3.6e-10)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.7e-7) || ~((z <= 3.6e-10))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (x / y) + ((2.0 / t) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.7e-7], N[Not[LessEqual[z, 3.6e-10]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-7} \lor \neg \left(z \leq 3.6 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{\frac{2}{t}}{z}\\
\end{array}
\end{array}
if z < -1.69999999999999987e-7 or 3.6e-10 < z Initial program 73.8%
Taylor expanded in t around 0 100.0%
metadata-eval100.0%
associate-*r/100.0%
+-commutative100.0%
associate-*r/100.0%
metadata-eval100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
associate-/l/100.0%
Simplified100.0%
Taylor expanded in z around inf 98.8%
sub-neg98.8%
associate-*r/98.8%
metadata-eval98.8%
+-commutative98.8%
metadata-eval98.8%
associate-+l+98.8%
Simplified98.8%
if -1.69999999999999987e-7 < z < 3.6e-10Initial program 95.8%
Taylor expanded in z around 0 87.0%
associate-/r*87.1%
Simplified87.1%
Final simplification93.2%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5800000000000.0) (/ x y) (if (<= (/ x y) 8500000.0) (+ (/ 2.0 t) -2.0) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5800000000000.0) {
tmp = x / y;
} else if ((x / y) <= 8500000.0) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = (x / y) - 2.0;
}
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 / y) <= (-5800000000000.0d0)) then
tmp = x / y
else if ((x / y) <= 8500000.0d0) then
tmp = (2.0d0 / t) + (-2.0d0)
else
tmp = (x / y) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5800000000000.0) {
tmp = x / y;
} else if ((x / y) <= 8500000.0) {
tmp = (2.0 / t) + -2.0;
} else {
tmp = (x / y) - 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5800000000000.0: tmp = x / y elif (x / y) <= 8500000.0: tmp = (2.0 / t) + -2.0 else: tmp = (x / y) - 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5800000000000.0) tmp = Float64(x / y); elseif (Float64(x / y) <= 8500000.0) tmp = Float64(Float64(2.0 / t) + -2.0); else tmp = Float64(Float64(x / y) - 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5800000000000.0) tmp = x / y; elseif ((x / y) <= 8500000.0) tmp = (2.0 / t) + -2.0; else tmp = (x / y) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5800000000000.0], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 8500000.0], N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5800000000000:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 8500000:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -5.8e12Initial program 84.0%
Taylor expanded in x around inf 70.4%
if -5.8e12 < (/.f64 x y) < 8.5e6Initial program 83.9%
Taylor expanded in t around 0 99.9%
metadata-eval99.9%
associate-*r/99.9%
+-commutative99.9%
associate-*r/99.9%
metadata-eval99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
associate-/l/99.9%
Simplified99.9%
Taylor expanded in z around inf 63.4%
sub-neg63.4%
associate-*r/63.4%
metadata-eval63.4%
+-commutative63.4%
metadata-eval63.4%
associate-+l+63.4%
Simplified63.4%
Taylor expanded in x around 0 63.2%
sub-neg63.2%
associate-*r/63.2%
metadata-eval63.2%
metadata-eval63.2%
Simplified63.2%
if 8.5e6 < (/.f64 x y) Initial program 85.0%
Taylor expanded in t around inf 72.4%
Final simplification67.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -3900000000000.0) (not (<= (/ x y) 370000.0))) (/ x y) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3900000000000.0) || !((x / y) <= 370000.0)) {
tmp = x / y;
} else {
tmp = 2.0 / 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 / y) <= (-3900000000000.0d0)) .or. (.not. ((x / y) <= 370000.0d0))) then
tmp = x / y
else
tmp = 2.0d0 / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -3900000000000.0) || !((x / y) <= 370000.0)) {
tmp = x / y;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -3900000000000.0) or not ((x / y) <= 370000.0): tmp = x / y else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -3900000000000.0) || !(Float64(x / y) <= 370000.0)) tmp = Float64(x / y); else tmp = Float64(2.0 / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x / y) <= -3900000000000.0) || ~(((x / y) <= 370000.0))) tmp = x / y; else tmp = 2.0 / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -3900000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 370000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -3900000000000 \lor \neg \left(\frac{x}{y} \leq 370000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -3.9e12 or 3.7e5 < (/.f64 x y) Initial program 84.5%
Taylor expanded in x around inf 71.4%
if -3.9e12 < (/.f64 x y) < 3.7e5Initial program 83.9%
Taylor expanded in t around 0 63.5%
associate-*r/63.5%
metadata-eval63.5%
Simplified63.5%
Taylor expanded in z around inf 26.8%
Final simplification51.7%
(FPCore (x y z t) :precision binary64 (/ 2.0 t))
double code(double x, double y, double z, double t) {
return 2.0 / 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 = 2.0d0 / t
end function
public static double code(double x, double y, double z, double t) {
return 2.0 / t;
}
def code(x, y, z, t): return 2.0 / t
function code(x, y, z, t) return Float64(2.0 / t) end
function tmp = code(x, y, z, t) tmp = 2.0 / t; end
code[x_, y_, z_, t_] := N[(2.0 / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{t}
\end{array}
Initial program 84.3%
Taylor expanded in t around 0 45.6%
associate-*r/45.6%
metadata-eval45.6%
Simplified45.6%
Taylor expanded in z around inf 18.3%
Final simplification18.3%
(FPCore (x y z t) :precision binary64 (- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y))))
double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (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 = (((2.0d0 / z) + 2.0d0) / t) - (2.0d0 - (x / y))
end function
public static double code(double x, double y, double z, double t) {
return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y));
}
def code(x, y, z, t): return (((2.0 / z) + 2.0) / t) - (2.0 - (x / y))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(2.0 / z) + 2.0) / t) - Float64(2.0 - Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = (((2.0 / z) + 2.0) / t) - (2.0 - (x / y)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(2.0 / z), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] - N[(2.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{z} + 2}{t} - \left(2 - \frac{x}{y}\right)
\end{array}
herbie shell --seed 2024021
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:herbie-target
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))