
(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 13 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 z)) (- (/ 2.0 t) 2.0))))
double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 / (t * z)) + ((2.0 / 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 * z)) + ((2.0d0 / t) - 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (x / y) + ((2.0 / (t * z)) + ((2.0 / t) - 2.0));
}
def code(x, y, z, t): return (x / y) + ((2.0 / (t * z)) + ((2.0 / t) - 2.0))
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(2.0 / Float64(t * z)) + Float64(Float64(2.0 / t) - 2.0))) end
function tmp = code(x, y, z, t) tmp = (x / y) + ((2.0 / (t * z)) + ((2.0 / t) - 2.0)); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2}{t \cdot z} + \left(\frac{2}{t} - 2\right)\right)
\end{array}
Initial program 85.0%
Taylor expanded in t around 0 98.7%
associate--l+98.7%
associate-*r/98.7%
metadata-eval98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ 2.0 (* t z)) (/ 2.0 t))) (t_2 (- (/ x y) 2.0)))
(if (<= t -600.0)
t_2
(if (<= t 1.15e-124)
t_1
(if (<= t 7.2e-20) (+ (/ x y) (/ 2.0 t)) (if (<= t 0.058) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (2.0 / (t * z)) + (2.0 / t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -600.0) {
tmp = t_2;
} else if (t <= 1.15e-124) {
tmp = t_1;
} else if (t <= 7.2e-20) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 0.058) {
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 / (t * z)) + (2.0d0 / t)
t_2 = (x / y) - 2.0d0
if (t <= (-600.0d0)) then
tmp = t_2
else if (t <= 1.15d-124) then
tmp = t_1
else if (t <= 7.2d-20) then
tmp = (x / y) + (2.0d0 / t)
else if (t <= 0.058d0) 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 / (t * z)) + (2.0 / t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -600.0) {
tmp = t_2;
} else if (t <= 1.15e-124) {
tmp = t_1;
} else if (t <= 7.2e-20) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 0.058) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (2.0 / (t * z)) + (2.0 / t) t_2 = (x / y) - 2.0 tmp = 0 if t <= -600.0: tmp = t_2 elif t <= 1.15e-124: tmp = t_1 elif t <= 7.2e-20: tmp = (x / y) + (2.0 / t) elif t <= 0.058: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(2.0 / Float64(t * z)) + Float64(2.0 / t)) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -600.0) tmp = t_2; elseif (t <= 1.15e-124) tmp = t_1; elseif (t <= 7.2e-20) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (t <= 0.058) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (2.0 / (t * z)) + (2.0 / t); t_2 = (x / y) - 2.0; tmp = 0.0; if (t <= -600.0) tmp = t_2; elseif (t <= 1.15e-124) tmp = t_1; elseif (t <= 7.2e-20) tmp = (x / y) + (2.0 / t); elseif (t <= 0.058) 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[(t * z), $MachinePrecision]), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -600.0], t$95$2, If[LessEqual[t, 1.15e-124], t$95$1, If[LessEqual[t, 7.2e-20], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.058], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{t \cdot z} + \frac{2}{t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -600:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-20}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;t \leq 0.058:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -600 or 0.0580000000000000029 < t Initial program 69.2%
Taylor expanded in t around inf 89.7%
if -600 < t < 1.15000000000000006e-124 or 7.19999999999999948e-20 < t < 0.0580000000000000029Initial program 97.1%
Taylor expanded in t around 0 83.2%
associate-*r/83.2%
metadata-eval83.2%
Simplified83.2%
Taylor expanded in z around 0 83.3%
associate-*r/83.3%
metadata-eval83.3%
associate-*r/83.3%
metadata-eval83.3%
+-commutative83.3%
Simplified83.3%
if 1.15000000000000006e-124 < t < 7.19999999999999948e-20Initial program 99.7%
Taylor expanded in t around 0 99.7%
Taylor expanded in z around inf 86.7%
associate-*r/86.7%
metadata-eval86.7%
+-commutative86.7%
Simplified86.7%
Final simplification86.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 t))) (t_2 (- (/ x y) 2.0)))
(if (<= t -0.0105)
t_2
(if (<= t -2.55e-210)
t_1
(if (<= t 8.5e-179) (/ 2.0 (* t z)) (if (<= t 0.0008) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -0.0105) {
tmp = t_2;
} else if (t <= -2.55e-210) {
tmp = t_1;
} else if (t <= 8.5e-179) {
tmp = 2.0 / (t * z);
} else if (t <= 0.0008) {
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 = (x / y) + (2.0d0 / t)
t_2 = (x / y) - 2.0d0
if (t <= (-0.0105d0)) then
tmp = t_2
else if (t <= (-2.55d-210)) then
tmp = t_1
else if (t <= 8.5d-179) then
tmp = 2.0d0 / (t * z)
else if (t <= 0.0008d0) 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 = (x / y) + (2.0 / t);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -0.0105) {
tmp = t_2;
} else if (t <= -2.55e-210) {
tmp = t_1;
} else if (t <= 8.5e-179) {
tmp = 2.0 / (t * z);
} else if (t <= 0.0008) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / t) t_2 = (x / y) - 2.0 tmp = 0 if t <= -0.0105: tmp = t_2 elif t <= -2.55e-210: tmp = t_1 elif t <= 8.5e-179: tmp = 2.0 / (t * z) elif t <= 0.0008: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / t)) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -0.0105) tmp = t_2; elseif (t <= -2.55e-210) tmp = t_1; elseif (t <= 8.5e-179) tmp = Float64(2.0 / Float64(t * z)); elseif (t <= 0.0008) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / t); t_2 = (x / y) - 2.0; tmp = 0.0; if (t <= -0.0105) tmp = t_2; elseif (t <= -2.55e-210) tmp = t_1; elseif (t <= 8.5e-179) tmp = 2.0 / (t * z); elseif (t <= 0.0008) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -0.0105], t$95$2, If[LessEqual[t, -2.55e-210], t$95$1, If[LessEqual[t, 8.5e-179], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0008], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{t}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -0.0105:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.55 \cdot 10^{-210}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-179}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;t \leq 0.0008:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -0.0105000000000000007 or 8.00000000000000038e-4 < t Initial program 69.8%
Taylor expanded in t around inf 88.1%
if -0.0105000000000000007 < t < -2.54999999999999998e-210 or 8.49999999999999932e-179 < t < 8.00000000000000038e-4Initial program 99.7%
Taylor expanded in t around 0 98.4%
Taylor expanded in z around inf 68.3%
associate-*r/68.3%
metadata-eval68.3%
+-commutative68.3%
Simplified68.3%
if -2.54999999999999998e-210 < t < 8.49999999999999932e-179Initial program 93.2%
Taylor expanded in t around 0 93.3%
associate--l+93.3%
associate-*r/93.3%
metadata-eval93.3%
Simplified93.3%
Taylor expanded in z around 0 66.2%
Final simplification76.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ 2.0 (/ 2.0 z)) t)) (t_2 (- (/ x y) 2.0)))
(if (<= t -104.0)
t_2
(if (<= t 1.4e-124)
t_1
(if (<= t 8.5e-19) (+ (/ x y) (/ 2.0 t)) (if (<= t 0.0023) 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 <= -104.0) {
tmp = t_2;
} else if (t <= 1.4e-124) {
tmp = t_1;
} else if (t <= 8.5e-19) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 0.0023) {
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 <= (-104.0d0)) then
tmp = t_2
else if (t <= 1.4d-124) then
tmp = t_1
else if (t <= 8.5d-19) then
tmp = (x / y) + (2.0d0 / t)
else if (t <= 0.0023d0) 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 <= -104.0) {
tmp = t_2;
} else if (t <= 1.4e-124) {
tmp = t_1;
} else if (t <= 8.5e-19) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 0.0023) {
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 <= -104.0: tmp = t_2 elif t <= 1.4e-124: tmp = t_1 elif t <= 8.5e-19: tmp = (x / y) + (2.0 / t) elif t <= 0.0023: 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 <= -104.0) tmp = t_2; elseif (t <= 1.4e-124) tmp = t_1; elseif (t <= 8.5e-19) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (t <= 0.0023) 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 <= -104.0) tmp = t_2; elseif (t <= 1.4e-124) tmp = t_1; elseif (t <= 8.5e-19) tmp = (x / y) + (2.0 / t); elseif (t <= 0.0023) 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, -104.0], t$95$2, If[LessEqual[t, 1.4e-124], t$95$1, If[LessEqual[t, 8.5e-19], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0023], 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 -104:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;t \leq 0.0023:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -104 or 0.0023 < t Initial program 69.2%
Taylor expanded in t around inf 89.7%
if -104 < t < 1.39999999999999999e-124 or 8.50000000000000003e-19 < t < 0.0023Initial program 97.1%
Taylor expanded in t around 0 83.2%
associate-*r/83.2%
metadata-eval83.2%
Simplified83.2%
if 1.39999999999999999e-124 < t < 8.50000000000000003e-19Initial program 99.7%
Taylor expanded in t around 0 99.7%
Taylor expanded in z around inf 86.7%
associate-*r/86.7%
metadata-eval86.7%
+-commutative86.7%
Simplified86.7%
Final simplification86.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ 2.0 (/ 2.0 z))) (t_2 (- (/ x y) 2.0)))
(if (<= t -0.065)
t_2
(if (<= t 1.45e-124)
(* t_1 (/ 1.0 t))
(if (<= t 1.25e-18)
(+ (/ x y) (/ 2.0 t))
(if (<= t 0.0054) (/ t_1 t) t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 + (2.0 / z);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -0.065) {
tmp = t_2;
} else if (t <= 1.45e-124) {
tmp = t_1 * (1.0 / t);
} else if (t <= 1.25e-18) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 0.0054) {
tmp = t_1 / t;
} 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_2 = (x / y) - 2.0d0
if (t <= (-0.065d0)) then
tmp = t_2
else if (t <= 1.45d-124) then
tmp = t_1 * (1.0d0 / t)
else if (t <= 1.25d-18) then
tmp = (x / y) + (2.0d0 / t)
else if (t <= 0.0054d0) then
tmp = t_1 / t
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);
double t_2 = (x / y) - 2.0;
double tmp;
if (t <= -0.065) {
tmp = t_2;
} else if (t <= 1.45e-124) {
tmp = t_1 * (1.0 / t);
} else if (t <= 1.25e-18) {
tmp = (x / y) + (2.0 / t);
} else if (t <= 0.0054) {
tmp = t_1 / t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 + (2.0 / z) t_2 = (x / y) - 2.0 tmp = 0 if t <= -0.065: tmp = t_2 elif t <= 1.45e-124: tmp = t_1 * (1.0 / t) elif t <= 1.25e-18: tmp = (x / y) + (2.0 / t) elif t <= 0.0054: tmp = t_1 / t else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 + Float64(2.0 / z)) t_2 = Float64(Float64(x / y) - 2.0) tmp = 0.0 if (t <= -0.065) tmp = t_2; elseif (t <= 1.45e-124) tmp = Float64(t_1 * Float64(1.0 / t)); elseif (t <= 1.25e-18) tmp = Float64(Float64(x / y) + Float64(2.0 / t)); elseif (t <= 0.0054) tmp = Float64(t_1 / t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 + (2.0 / z); t_2 = (x / y) - 2.0; tmp = 0.0; if (t <= -0.065) tmp = t_2; elseif (t <= 1.45e-124) tmp = t_1 * (1.0 / t); elseif (t <= 1.25e-18) tmp = (x / y) + (2.0 / t); elseif (t <= 0.0054) tmp = t_1 / t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[t, -0.065], t$95$2, If[LessEqual[t, 1.45e-124], N[(t$95$1 * N[(1.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e-18], N[(N[(x / y), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0054], N[(t$95$1 / t), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 + \frac{2}{z}\\
t_2 := \frac{x}{y} - 2\\
\mathbf{if}\;t \leq -0.065:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-124}:\\
\;\;\;\;t\_1 \cdot \frac{1}{t}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-18}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t}\\
\mathbf{elif}\;t \leq 0.0054:\\
\;\;\;\;\frac{t\_1}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -0.065000000000000002 or 0.0054000000000000003 < t Initial program 69.2%
Taylor expanded in t around inf 89.7%
if -0.065000000000000002 < t < 1.4500000000000001e-124Initial program 97.0%
Taylor expanded in t around 0 83.0%
associate-*r/83.0%
metadata-eval83.0%
Simplified83.0%
div-inv83.0%
Applied egg-rr83.0%
if 1.4500000000000001e-124 < t < 1.25000000000000009e-18Initial program 99.7%
Taylor expanded in t around 0 99.7%
Taylor expanded in z around inf 86.7%
associate-*r/86.7%
metadata-eval86.7%
+-commutative86.7%
Simplified86.7%
if 1.25000000000000009e-18 < t < 0.0054000000000000003Initial program 99.7%
Taylor expanded in t around 0 89.1%
associate-*r/89.1%
metadata-eval89.1%
Simplified89.1%
Final simplification86.5%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -10000000000.0) (not (<= (/ x y) 1e-6))) (+ (/ x y) (/ (+ 2.0 (* 2.0 z)) (* t z))) (+ (/ 2.0 (* t z)) (+ (/ 2.0 t) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -10000000000.0) || !((x / y) <= 1e-6)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
} else {
tmp = (2.0 / (t * z)) + ((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) <= (-10000000000.0d0)) .or. (.not. ((x / y) <= 1d-6))) then
tmp = (x / y) + ((2.0d0 + (2.0d0 * z)) / (t * z))
else
tmp = (2.0d0 / (t * z)) + ((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) <= -10000000000.0) || !((x / y) <= 1e-6)) {
tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z));
} else {
tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -10000000000.0) or not ((x / y) <= 1e-6): tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)) else: tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -10000000000.0) || !(Float64(x / y) <= 1e-6)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 + Float64(2.0 * z)) / Float64(t * z))); else tmp = Float64(Float64(2.0 / Float64(t * z)) + 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) <= -10000000000.0) || ~(((x / y) <= 1e-6))) tmp = (x / y) + ((2.0 + (2.0 * z)) / (t * z)); else tmp = (2.0 / (t * z)) + ((2.0 / t) + -2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x / y), $MachinePrecision], -10000000000.0], N[Not[LessEqual[N[(x / y), $MachinePrecision], 1e-6]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 + N[(2.0 * z), $MachinePrecision]), $MachinePrecision] / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -10000000000 \lor \neg \left(\frac{x}{y} \leq 10^{-6}\right):\\
\;\;\;\;\frac{x}{y} + \frac{2 + 2 \cdot z}{t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z} + \left(\frac{2}{t} + -2\right)\\
\end{array}
\end{array}
if (/.f64 x y) < -1e10 or 9.99999999999999955e-7 < (/.f64 x y) Initial program 86.9%
Taylor expanded in t around 0 97.3%
if -1e10 < (/.f64 x y) < 9.99999999999999955e-7Initial program 82.6%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 99.1%
sub-neg99.1%
associate-*r/99.1%
metadata-eval99.1%
associate-*r/99.1%
metadata-eval99.1%
+-commutative99.1%
metadata-eval99.1%
associate-+r+99.1%
+-commutative99.1%
Simplified99.1%
Final simplification98.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ x y) 2.0)))
(if (<= t -1.16e-39)
t_1
(if (<= t 1.1e-178) (/ 2.0 (* t z)) (if (<= t 9.4e-49) (/ 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.16e-39) {
tmp = t_1;
} else if (t <= 1.1e-178) {
tmp = 2.0 / (t * z);
} else if (t <= 9.4e-49) {
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.16d-39)) then
tmp = t_1
else if (t <= 1.1d-178) then
tmp = 2.0d0 / (t * z)
else if (t <= 9.4d-49) 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.16e-39) {
tmp = t_1;
} else if (t <= 1.1e-178) {
tmp = 2.0 / (t * z);
} else if (t <= 9.4e-49) {
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.16e-39: tmp = t_1 elif t <= 1.1e-178: tmp = 2.0 / (t * z) elif t <= 9.4e-49: 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.16e-39) tmp = t_1; elseif (t <= 1.1e-178) tmp = Float64(2.0 / Float64(t * z)); elseif (t <= 9.4e-49) 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.16e-39) tmp = t_1; elseif (t <= 1.1e-178) tmp = 2.0 / (t * z); elseif (t <= 9.4e-49) 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.16e-39], t$95$1, If[LessEqual[t, 1.1e-178], N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.4e-49], 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.16 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-178}:\\
\;\;\;\;\frac{2}{t \cdot z}\\
\mathbf{elif}\;t \leq 9.4 \cdot 10^{-49}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.16e-39 or 9.40000000000000043e-49 < t Initial program 74.7%
Taylor expanded in t around inf 81.2%
if -1.16e-39 < t < 1.1000000000000001e-178Initial program 96.5%
Taylor expanded in t around 0 96.6%
associate--l+96.6%
associate-*r/96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in z around 0 58.6%
if 1.1000000000000001e-178 < t < 9.40000000000000043e-49Initial program 99.6%
Taylor expanded in t around 0 80.0%
associate-*r/80.0%
metadata-eval80.0%
Simplified80.0%
Taylor expanded in z around inf 58.2%
Final simplification70.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -9.5e+98) (not (<= (/ x y) 330000000000.0))) (/ x y) (+ (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -9.5e+98) || !((x / y) <= 330000000000.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) <= (-9.5d+98)) .or. (.not. ((x / y) <= 330000000000.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) <= -9.5e+98) || !((x / y) <= 330000000000.0)) {
tmp = x / y;
} else {
tmp = (2.0 / t) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -9.5e+98) or not ((x / y) <= 330000000000.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) <= -9.5e+98) || !(Float64(x / y) <= 330000000000.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) <= -9.5e+98) || ~(((x / y) <= 330000000000.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], -9.5e+98], N[Not[LessEqual[N[(x / y), $MachinePrecision], 330000000000.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 -9.5 \cdot 10^{+98} \lor \neg \left(\frac{x}{y} \leq 330000000000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.5000000000000001e98 or 3.3e11 < (/.f64 x y) Initial program 85.7%
Taylor expanded in x around inf 76.6%
if -9.5000000000000001e98 < (/.f64 x y) < 3.3e11Initial program 84.5%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 65.0%
sub-neg65.0%
associate-*r/65.0%
metadata-eval65.0%
metadata-eval65.0%
+-commutative65.0%
Simplified65.0%
Taylor expanded in x around 0 60.5%
sub-neg60.5%
associate-*r/60.5%
metadata-eval60.5%
metadata-eval60.5%
+-commutative60.5%
Simplified60.5%
Final simplification67.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.35e-35) (not (<= t 1.5e-124))) (+ (/ x y) (+ (/ 2.0 t) -2.0)) (+ (/ 2.0 (* t z)) (/ 2.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.35e-35) || !(t <= 1.5e-124)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (2.0 / (t * z)) + (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 ((t <= (-2.35d-35)) .or. (.not. (t <= 1.5d-124))) then
tmp = (x / y) + ((2.0d0 / t) + (-2.0d0))
else
tmp = (2.0d0 / (t * z)) + (2.0d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.35e-35) || !(t <= 1.5e-124)) {
tmp = (x / y) + ((2.0 / t) + -2.0);
} else {
tmp = (2.0 / (t * z)) + (2.0 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.35e-35) or not (t <= 1.5e-124): tmp = (x / y) + ((2.0 / t) + -2.0) else: tmp = (2.0 / (t * z)) + (2.0 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.35e-35) || !(t <= 1.5e-124)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(2.0 / Float64(t * z)) + Float64(2.0 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.35e-35) || ~((t <= 1.5e-124))) tmp = (x / y) + ((2.0 / t) + -2.0); else tmp = (2.0 / (t * z)) + (2.0 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.35e-35], N[Not[LessEqual[t, 1.5e-124]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(2.0 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{-35} \lor \neg \left(t \leq 1.5 \cdot 10^{-124}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t \cdot z} + \frac{2}{t}\\
\end{array}
\end{array}
if t < -2.35e-35 or 1.5e-124 < t Initial program 77.7%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 87.2%
sub-neg87.2%
associate-*r/87.2%
metadata-eval87.2%
metadata-eval87.2%
+-commutative87.2%
Simplified87.2%
if -2.35e-35 < t < 1.5e-124Initial program 96.7%
Taylor expanded in t around 0 85.9%
associate-*r/85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in z around 0 85.9%
associate-*r/85.9%
metadata-eval85.9%
associate-*r/85.9%
metadata-eval85.9%
+-commutative85.9%
Simplified85.9%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.8e-5) (not (<= z 7.2e-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 <= -5.8e-5) || !(z <= 7.2e-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 <= (-5.8d-5)) .or. (.not. (z <= 7.2d-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 <= -5.8e-5) || !(z <= 7.2e-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 <= -5.8e-5) or not (z <= 7.2e-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 <= -5.8e-5) || !(z <= 7.2e-10)) tmp = Float64(Float64(x / y) + Float64(Float64(2.0 / t) + -2.0)); else tmp = Float64(Float64(x / y) + Float64(2.0 / Float64(t * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.8e-5) || ~((z <= 7.2e-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, -5.8e-5], N[Not[LessEqual[z, 7.2e-10]], $MachinePrecision]], N[(N[(x / y), $MachinePrecision] + N[(N[(2.0 / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-5} \lor \neg \left(z \leq 7.2 \cdot 10^{-10}\right):\\
\;\;\;\;\frac{x}{y} + \left(\frac{2}{t} + -2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + \frac{2}{t \cdot z}\\
\end{array}
\end{array}
if z < -5.8e-5 or 7.2e-10 < z Initial program 73.5%
Taylor expanded in t around 0 100.0%
associate--l+100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 99.2%
sub-neg99.2%
associate-*r/99.2%
metadata-eval99.2%
metadata-eval99.2%
+-commutative99.2%
Simplified99.2%
if -5.8e-5 < z < 7.2e-10Initial program 97.4%
Taylor expanded in z around 0 89.1%
Final simplification94.4%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -9.5e+98) (/ x y) (if (<= (/ x y) 5.8e-41) (+ (/ 2.0 t) -2.0) (- (/ x y) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -9.5e+98) {
tmp = x / y;
} else if ((x / y) <= 5.8e-41) {
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) <= (-9.5d+98)) then
tmp = x / y
else if ((x / y) <= 5.8d-41) 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) <= -9.5e+98) {
tmp = x / y;
} else if ((x / y) <= 5.8e-41) {
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) <= -9.5e+98: tmp = x / y elif (x / y) <= 5.8e-41: 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) <= -9.5e+98) tmp = Float64(x / y); elseif (Float64(x / y) <= 5.8e-41) 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) <= -9.5e+98) tmp = x / y; elseif ((x / y) <= 5.8e-41) 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], -9.5e+98], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5.8e-41], 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 -9.5 \cdot 10^{+98}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5.8 \cdot 10^{-41}:\\
\;\;\;\;\frac{2}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - 2\\
\end{array}
\end{array}
if (/.f64 x y) < -9.5000000000000001e98Initial program 80.8%
Taylor expanded in x around inf 81.0%
if -9.5000000000000001e98 < (/.f64 x y) < 5.79999999999999955e-41Initial program 85.6%
Taylor expanded in t around 0 99.9%
associate--l+99.9%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 63.9%
sub-neg63.9%
associate-*r/63.9%
metadata-eval63.9%
metadata-eval63.9%
+-commutative63.9%
Simplified63.9%
Taylor expanded in x around 0 60.5%
sub-neg60.5%
associate-*r/60.5%
metadata-eval60.5%
metadata-eval60.5%
+-commutative60.5%
Simplified60.5%
if 5.79999999999999955e-41 < (/.f64 x y) Initial program 87.0%
Taylor expanded in t around inf 71.2%
Final simplification67.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (/ x y) -9.5e+98) (not (<= (/ x y) 76000000000.0))) (/ x y) (/ 2.0 t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x / y) <= -9.5e+98) || !((x / y) <= 76000000000.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) <= (-9.5d+98)) .or. (.not. ((x / y) <= 76000000000.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) <= -9.5e+98) || !((x / y) <= 76000000000.0)) {
tmp = x / y;
} else {
tmp = 2.0 / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x / y) <= -9.5e+98) or not ((x / y) <= 76000000000.0): tmp = x / y else: tmp = 2.0 / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x / y) <= -9.5e+98) || !(Float64(x / y) <= 76000000000.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) <= -9.5e+98) || ~(((x / y) <= 76000000000.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], -9.5e+98], N[Not[LessEqual[N[(x / y), $MachinePrecision], 76000000000.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(2.0 / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -9.5 \cdot 10^{+98} \lor \neg \left(\frac{x}{y} \leq 76000000000\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t}\\
\end{array}
\end{array}
if (/.f64 x y) < -9.5000000000000001e98 or 7.6e10 < (/.f64 x y) Initial program 85.7%
Taylor expanded in x around inf 76.6%
if -9.5000000000000001e98 < (/.f64 x y) < 7.6e10Initial program 84.5%
Taylor expanded in t around 0 65.5%
associate-*r/65.5%
metadata-eval65.5%
Simplified65.5%
Taylor expanded in z around inf 31.5%
Final simplification51.2%
(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 85.0%
Taylor expanded in t around 0 49.6%
associate-*r/49.6%
metadata-eval49.6%
Simplified49.6%
Taylor expanded in z around inf 20.9%
Final simplification20.9%
(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 2024046
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(- (/ (+ (/ 2.0 z) 2.0) t) (- 2.0 (/ x y)))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))