
(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 (/ 2.0 z)) t) -2.0)))
double code(double x, double y, double z, double t) {
return (x / y) + (((2.0 + (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 + (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 + (2.0 / z)) / t) + -2.0);
}
def code(x, y, z, t): return (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0)
function code(x, y, z, t) return Float64(Float64(x / y) + Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0)) end
function tmp = code(x, y, z, t) tmp = (x / y) + (((2.0 + (2.0 / z)) / t) + -2.0); end
code[x_, y_, z_, t_] := N[(N[(x / y), $MachinePrecision] + N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} + \left(\frac{2 + \frac{2}{z}}{t} + -2\right)
\end{array}
Initial program 84.3%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified98.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (* 2.0 (/ y t)) z)) y)))
(if (<= (/ x y) -5e+23)
t_1
(if (<= (/ x y) 4e-27) (+ (/ 2.0 t) (+ -2.0 (/ 2.0 (* z t)))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x + ((2.0 * (y / t)) / z)) / y;
double tmp;
if ((x / y) <= -5e+23) {
tmp = t_1;
} else if ((x / y) <= 4e-27) {
tmp = (2.0 / t) + (-2.0 + (2.0 / (z * 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 + ((2.0d0 * (y / t)) / z)) / y
if ((x / y) <= (-5d+23)) then
tmp = t_1
else if ((x / y) <= 4d-27) then
tmp = (2.0d0 / t) + ((-2.0d0) + (2.0d0 / (z * 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 + ((2.0 * (y / t)) / z)) / y;
double tmp;
if ((x / y) <= -5e+23) {
tmp = t_1;
} else if ((x / y) <= 4e-27) {
tmp = (2.0 / t) + (-2.0 + (2.0 / (z * t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + ((2.0 * (y / t)) / z)) / y tmp = 0 if (x / y) <= -5e+23: tmp = t_1 elif (x / y) <= 4e-27: tmp = (2.0 / t) + (-2.0 + (2.0 / (z * t))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(2.0 * Float64(y / t)) / z)) / y) tmp = 0.0 if (Float64(x / y) <= -5e+23) tmp = t_1; elseif (Float64(x / y) <= 4e-27) tmp = Float64(Float64(2.0 / t) + Float64(-2.0 + Float64(2.0 / Float64(z * t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + ((2.0 * (y / t)) / z)) / y; tmp = 0.0; if ((x / y) <= -5e+23) tmp = t_1; elseif ((x / y) <= 4e-27) tmp = (2.0 / t) + (-2.0 + (2.0 / (z * t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(2.0 * N[(y / t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -5e+23], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 4e-27], N[(N[(2.0 / t), $MachinePrecision] + N[(-2.0 + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{2 \cdot \frac{y}{t}}{z}}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{-27}:\\
\;\;\;\;\frac{2}{t} + \left(-2 + \frac{2}{z \cdot t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -4.9999999999999999e23 or 4.0000000000000002e-27 < (/.f64 x y) Initial program 82.7%
Taylor expanded in t around 0
+-lowering-+.f64N/A
*-lowering-*.f6496.8%
Simplified96.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
Simplified97.5%
Taylor expanded in z around 0
associate-/r*N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6495.4%
Simplified95.4%
if -4.9999999999999999e23 < (/.f64 x y) < 4.0000000000000002e-27Initial program 86.0%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.8%
Taylor expanded in x around 0
Simplified99.0%
+-commutativeN/A
div-invN/A
*-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
frac-timesN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f6499.1%
Applied egg-rr99.1%
Final simplification97.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 2.0 (* z t))) (t_2 (+ (/ x y) t_1)))
(if (<= (/ x y) -5e+23)
t_2
(if (<= (/ x y) 4e-27) (+ (/ 2.0 t) (+ -2.0 t_1)) t_2))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 / (z * t);
double t_2 = (x / y) + t_1;
double tmp;
if ((x / y) <= -5e+23) {
tmp = t_2;
} else if ((x / y) <= 4e-27) {
tmp = (2.0 / t) + (-2.0 + 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 / (z * t)
t_2 = (x / y) + t_1
if ((x / y) <= (-5d+23)) then
tmp = t_2
else if ((x / y) <= 4d-27) then
tmp = (2.0d0 / t) + ((-2.0d0) + 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 / (z * t);
double t_2 = (x / y) + t_1;
double tmp;
if ((x / y) <= -5e+23) {
tmp = t_2;
} else if ((x / y) <= 4e-27) {
tmp = (2.0 / t) + (-2.0 + t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 / (z * t) t_2 = (x / y) + t_1 tmp = 0 if (x / y) <= -5e+23: tmp = t_2 elif (x / y) <= 4e-27: tmp = (2.0 / t) + (-2.0 + t_1) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(2.0 / Float64(z * t)) t_2 = Float64(Float64(x / y) + t_1) tmp = 0.0 if (Float64(x / y) <= -5e+23) tmp = t_2; elseif (Float64(x / y) <= 4e-27) tmp = Float64(Float64(2.0 / t) + Float64(-2.0 + t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 / (z * t); t_2 = (x / y) + t_1; tmp = 0.0; if ((x / y) <= -5e+23) tmp = t_2; elseif ((x / y) <= 4e-27) tmp = (2.0 / t) + (-2.0 + t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -5e+23], t$95$2, If[LessEqual[N[(x / y), $MachinePrecision], 4e-27], N[(N[(2.0 / t), $MachinePrecision] + N[(-2.0 + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{2}{z \cdot t}\\
t_2 := \frac{x}{y} + t\_1\\
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{-27}:\\
\;\;\;\;\frac{2}{t} + \left(-2 + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 x y) < -4.9999999999999999e23 or 4.0000000000000002e-27 < (/.f64 x y) Initial program 82.7%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified97.7%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6493.1%
Simplified93.1%
if -4.9999999999999999e23 < (/.f64 x y) < 4.0000000000000002e-27Initial program 86.0%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.8%
Taylor expanded in x around 0
Simplified99.0%
+-commutativeN/A
div-invN/A
*-commutativeN/A
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
div-invN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
frac-timesN/A
metadata-evalN/A
/-lowering-/.f64N/A
*-lowering-*.f6499.1%
Applied egg-rr99.1%
Final simplification96.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5.8e+19) (/ x y) (if (<= (/ x y) -4.7e-34) (/ 2.0 t) (if (<= (/ x y) 3e-11) -2.0 (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5.8e+19) {
tmp = x / y;
} else if ((x / y) <= -4.7e-34) {
tmp = 2.0 / t;
} else if ((x / y) <= 3e-11) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-5.8d+19)) then
tmp = x / y
else if ((x / y) <= (-4.7d-34)) then
tmp = 2.0d0 / t
else if ((x / y) <= 3d-11) then
tmp = -2.0d0
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5.8e+19) {
tmp = x / y;
} else if ((x / y) <= -4.7e-34) {
tmp = 2.0 / t;
} else if ((x / y) <= 3e-11) {
tmp = -2.0;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5.8e+19: tmp = x / y elif (x / y) <= -4.7e-34: tmp = 2.0 / t elif (x / y) <= 3e-11: tmp = -2.0 else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5.8e+19) tmp = Float64(x / y); elseif (Float64(x / y) <= -4.7e-34) tmp = Float64(2.0 / t); elseif (Float64(x / y) <= 3e-11) tmp = -2.0; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5.8e+19) tmp = x / y; elseif ((x / y) <= -4.7e-34) tmp = 2.0 / t; elseif ((x / y) <= 3e-11) tmp = -2.0; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5.8e+19], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], -4.7e-34], N[(2.0 / t), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 3e-11], -2.0, N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5.8 \cdot 10^{+19}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq -4.7 \cdot 10^{-34}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{elif}\;\frac{x}{y} \leq 3 \cdot 10^{-11}:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -5.8e19 or 3e-11 < (/.f64 x y) Initial program 82.5%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified97.7%
Taylor expanded in x around inf
/-lowering-/.f6478.7%
Simplified78.7%
if -5.8e19 < (/.f64 x y) < -4.70000000000000002e-34Initial program 81.0%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.9%
Taylor expanded in x around 0
Simplified93.5%
Taylor expanded in z around inf
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6457.8%
Simplified57.8%
Taylor expanded in t around 0
/-lowering-/.f6441.5%
Simplified41.5%
if -4.70000000000000002e-34 < (/.f64 x y) < 3e-11Initial program 86.9%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.8%
Taylor expanded in x around 0
Simplified99.8%
Taylor expanded in t around inf
Simplified43.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ x y) (/ 2.0 (* z t)))))
(if (<= (/ x y) -5e+23)
t_1
(if (<= (/ x y) 4e-27) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + (2.0 / (z * t));
double tmp;
if ((x / y) <= -5e+23) {
tmp = t_1;
} else if ((x / y) <= 4e-27) {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
} 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 / (z * t))
if ((x / y) <= (-5d+23)) then
tmp = t_1
else if ((x / y) <= 4d-27) then
tmp = ((2.0d0 + (2.0d0 / z)) / t) + (-2.0d0)
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 / (z * t));
double tmp;
if ((x / y) <= -5e+23) {
tmp = t_1;
} else if ((x / y) <= 4e-27) {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + (2.0 / (z * t)) tmp = 0 if (x / y) <= -5e+23: tmp = t_1 elif (x / y) <= 4e-27: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) + Float64(2.0 / Float64(z * t))) tmp = 0.0 if (Float64(x / y) <= -5e+23) tmp = t_1; elseif (Float64(x / y) <= 4e-27) tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / t) + -2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) + (2.0 / (z * t)); tmp = 0.0; if ((x / y) <= -5e+23) tmp = t_1; elseif ((x / y) <= 4e-27) tmp = ((2.0 + (2.0 / z)) / t) + -2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] + N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -5e+23], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 4e-27], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -2.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + \frac{2}{z \cdot t}\\
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 4 \cdot 10^{-27}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -4.9999999999999999e23 or 4.0000000000000002e-27 < (/.f64 x y) Initial program 82.7%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified97.7%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6493.1%
Simplified93.1%
if -4.9999999999999999e23 < (/.f64 x y) < 4.0000000000000002e-27Initial program 86.0%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.8%
Taylor expanded in x around 0
Simplified99.0%
Final simplification95.9%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -2e+67) (/ x y) (if (<= (/ x y) 5e-11) (+ (/ (+ 2.0 (/ 2.0 z)) t) -2.0) (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+67) {
tmp = x / y;
} else if ((x / y) <= 5e-11) {
tmp = ((2.0 + (2.0 / z)) / 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) <= (-2d+67)) then
tmp = x / y
else if ((x / y) <= 5d-11) then
tmp = ((2.0d0 + (2.0d0 / z)) / 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) <= -2e+67) {
tmp = x / y;
} else if ((x / y) <= 5e-11) {
tmp = ((2.0 + (2.0 / z)) / t) + -2.0;
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e+67: tmp = x / y elif (x / y) <= 5e-11: tmp = ((2.0 + (2.0 / z)) / t) + -2.0 else: tmp = (x / y) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e+67) tmp = Float64(x / y); elseif (Float64(x / y) <= 5e-11) tmp = Float64(Float64(Float64(2.0 + Float64(2.0 / z)) / 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) <= -2e+67) tmp = x / y; elseif ((x / y) <= 5e-11) tmp = ((2.0 + (2.0 / z)) / 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], -2e+67], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-11], N[(N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / 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 -2 \cdot 10^{+67}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-11}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t} + -2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.99999999999999997e67Initial program 83.0%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified96.2%
Taylor expanded in x around inf
/-lowering-/.f6487.0%
Simplified87.0%
if -1.99999999999999997e67 < (/.f64 x y) < 5.00000000000000018e-11Initial program 86.5%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.9%
Taylor expanded in x around 0
Simplified97.1%
if 5.00000000000000018e-11 < (/.f64 x y) Initial program 80.8%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified98.5%
Taylor expanded in t around inf
Simplified82.1%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -2e+67) (/ x y) (if (<= (/ x y) 5e-11) (+ -2.0 (/ (/ 2.0 z) t)) (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e+67) {
tmp = x / y;
} else if ((x / y) <= 5e-11) {
tmp = -2.0 + ((2.0 / z) / t);
} 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) <= (-2d+67)) then
tmp = x / y
else if ((x / y) <= 5d-11) then
tmp = (-2.0d0) + ((2.0d0 / z) / t)
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) <= -2e+67) {
tmp = x / y;
} else if ((x / y) <= 5e-11) {
tmp = -2.0 + ((2.0 / z) / t);
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e+67: tmp = x / y elif (x / y) <= 5e-11: tmp = -2.0 + ((2.0 / z) / t) else: tmp = (x / y) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e+67) tmp = Float64(x / y); elseif (Float64(x / y) <= 5e-11) tmp = Float64(-2.0 + Float64(Float64(2.0 / z) / t)); 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) <= -2e+67) tmp = x / y; elseif ((x / y) <= 5e-11) tmp = -2.0 + ((2.0 / z) / t); else tmp = (x / y) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e+67], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-11], N[(-2.0 + N[(N[(2.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{+67}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-11}:\\
\;\;\;\;-2 + \frac{\frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -1.99999999999999997e67Initial program 83.0%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified96.2%
Taylor expanded in x around inf
/-lowering-/.f6487.0%
Simplified87.0%
if -1.99999999999999997e67 < (/.f64 x y) < 5.00000000000000018e-11Initial program 86.5%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.9%
Taylor expanded in x around 0
Simplified97.1%
Taylor expanded in z around 0
/-lowering-/.f6473.8%
Simplified73.8%
if 5.00000000000000018e-11 < (/.f64 x y) Initial program 80.8%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified98.5%
Taylor expanded in t around inf
Simplified82.1%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e+23) (/ x y) (if (<= (/ x y) 5e-11) (+ -2.0 (/ 2.0 t)) (+ (/ x y) -2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e+23) {
tmp = x / y;
} else if ((x / y) <= 5e-11) {
tmp = -2.0 + (2.0 / t);
} 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) <= (-5d+23)) then
tmp = x / y
else if ((x / y) <= 5d-11) then
tmp = (-2.0d0) + (2.0d0 / t)
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) <= -5e+23) {
tmp = x / y;
} else if ((x / y) <= 5e-11) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = (x / y) + -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e+23: tmp = x / y elif (x / y) <= 5e-11: tmp = -2.0 + (2.0 / t) else: tmp = (x / y) + -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e+23) tmp = Float64(x / y); elseif (Float64(x / y) <= 5e-11) tmp = Float64(-2.0 + Float64(2.0 / t)); 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) <= -5e+23) tmp = x / y; elseif ((x / y) <= 5e-11) tmp = -2.0 + (2.0 / t); else tmp = (x / y) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e+23], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-11], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] + -2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{+23}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-11}:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y} + -2\\
\end{array}
\end{array}
if (/.f64 x y) < -4.9999999999999999e23Initial program 84.1%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified96.8%
Taylor expanded in x around inf
/-lowering-/.f6478.2%
Simplified78.2%
if -4.9999999999999999e23 < (/.f64 x y) < 5.00000000000000018e-11Initial program 86.2%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.8%
Taylor expanded in x around 0
Simplified99.0%
Taylor expanded in z around inf
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6462.5%
Simplified62.5%
if 5.00000000000000018e-11 < (/.f64 x y) Initial program 80.8%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified98.5%
Taylor expanded in t around inf
Simplified82.1%
Final simplification71.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -6e+20) (/ x y) (if (<= (/ x y) 620000.0) (+ -2.0 (/ 2.0 t)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -6e+20) {
tmp = x / y;
} else if ((x / y) <= 620000.0) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x / y) <= (-6d+20)) then
tmp = x / y
else if ((x / y) <= 620000.0d0) then
tmp = (-2.0d0) + (2.0d0 / t)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -6e+20) {
tmp = x / y;
} else if ((x / y) <= 620000.0) {
tmp = -2.0 + (2.0 / t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -6e+20: tmp = x / y elif (x / y) <= 620000.0: tmp = -2.0 + (2.0 / t) else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -6e+20) tmp = Float64(x / y); elseif (Float64(x / y) <= 620000.0) tmp = Float64(-2.0 + Float64(2.0 / t)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -6e+20) tmp = x / y; elseif ((x / y) <= 620000.0) tmp = -2.0 + (2.0 / t); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -6e+20], N[(x / y), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 620000.0], N[(-2.0 + N[(2.0 / t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -6 \cdot 10^{+20}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 620000:\\
\;\;\;\;-2 + \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -6e20 or 6.2e5 < (/.f64 x y) Initial program 82.4%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified97.7%
Taylor expanded in x around inf
/-lowering-/.f6479.3%
Simplified79.3%
if -6e20 < (/.f64 x y) < 6.2e5Initial program 86.2%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.8%
Taylor expanded in x around 0
Simplified99.0%
Taylor expanded in z around inf
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6462.5%
Simplified62.5%
Final simplification71.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ x y) -2.0))) (if (<= t -8.6e-31) t_1 (if (<= t 6.2e-52) (/ (+ 2.0 (/ 2.0 z)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (t <= -8.6e-31) {
tmp = t_1;
} else if (t <= 6.2e-52) {
tmp = (2.0 + (2.0 / z)) / 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 <= (-8.6d-31)) then
tmp = t_1
else if (t <= 6.2d-52) then
tmp = (2.0d0 + (2.0d0 / z)) / 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 <= -8.6e-31) {
tmp = t_1;
} else if (t <= 6.2e-52) {
tmp = (2.0 + (2.0 / z)) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if t <= -8.6e-31: tmp = t_1 elif t <= 6.2e-52: tmp = (2.0 + (2.0 / z)) / 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 <= -8.6e-31) tmp = t_1; elseif (t <= 6.2e-52) tmp = Float64(Float64(2.0 + Float64(2.0 / z)) / 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 <= -8.6e-31) tmp = t_1; elseif (t <= 6.2e-52) tmp = (2.0 + (2.0 / z)) / 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, -8.6e-31], t$95$1, If[LessEqual[t, 6.2e-52], N[(N[(2.0 + N[(2.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;t \leq -8.6 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-52}:\\
\;\;\;\;\frac{2 + \frac{2}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.6e-31 or 6.1999999999999998e-52 < t Initial program 76.3%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.9%
Taylor expanded in t around inf
Simplified81.7%
if -8.6e-31 < t < 6.1999999999999998e-52Initial program 96.9%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified96.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6479.0%
Simplified79.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ (/ x y) -2.0))) (if (<= z -5.8e-69) t_1 (if (<= z 1.3e-190) (/ 2.0 (* z t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) + -2.0;
double tmp;
if (z <= -5.8e-69) {
tmp = t_1;
} else if (z <= 1.3e-190) {
tmp = 2.0 / (z * 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 (z <= (-5.8d-69)) then
tmp = t_1
else if (z <= 1.3d-190) then
tmp = 2.0d0 / (z * 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 (z <= -5.8e-69) {
tmp = t_1;
} else if (z <= 1.3e-190) {
tmp = 2.0 / (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) + -2.0 tmp = 0 if z <= -5.8e-69: tmp = t_1 elif z <= 1.3e-190: tmp = 2.0 / (z * 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 (z <= -5.8e-69) tmp = t_1; elseif (z <= 1.3e-190) tmp = Float64(2.0 / Float64(z * 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 (z <= -5.8e-69) tmp = t_1; elseif (z <= 1.3e-190) tmp = 2.0 / (z * 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[z, -5.8e-69], t$95$1, If[LessEqual[z, 1.3e-190], N[(2.0 / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} + -2\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-190}:\\
\;\;\;\;\frac{2}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.7999999999999997e-69 or 1.2999999999999999e-190 < z Initial program 77.4%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified98.3%
Taylor expanded in t around inf
Simplified72.0%
if -5.7999999999999997e-69 < z < 1.2999999999999999e-190Initial program 99.9%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.8%
Taylor expanded in z around 0
/-lowering-/.f64N/A
*-lowering-*.f6471.5%
Simplified71.5%
Final simplification71.8%
(FPCore (x y z t) :precision binary64 (if (<= t -130000.0) -2.0 (if (<= t 8.5e+20) (/ 2.0 t) -2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -130000.0) {
tmp = -2.0;
} else if (t <= 8.5e+20) {
tmp = 2.0 / t;
} else {
tmp = -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 (t <= (-130000.0d0)) then
tmp = -2.0d0
else if (t <= 8.5d+20) then
tmp = 2.0d0 / t
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -130000.0) {
tmp = -2.0;
} else if (t <= 8.5e+20) {
tmp = 2.0 / t;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -130000.0: tmp = -2.0 elif t <= 8.5e+20: tmp = 2.0 / t else: tmp = -2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -130000.0) tmp = -2.0; elseif (t <= 8.5e+20) tmp = Float64(2.0 / t); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -130000.0) tmp = -2.0; elseif (t <= 8.5e+20) tmp = 2.0 / t; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -130000.0], -2.0, If[LessEqual[t, 8.5e+20], N[(2.0 / t), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -130000:\\
\;\;\;\;-2\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+20}:\\
\;\;\;\;\frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if t < -1.3e5 or 8.5e20 < t Initial program 72.3%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified99.9%
Taylor expanded in x around 0
Simplified50.6%
Taylor expanded in t around inf
Simplified36.7%
if -1.3e5 < t < 8.5e20Initial program 97.4%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified97.4%
Taylor expanded in x around 0
Simplified72.5%
Taylor expanded in z around inf
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6430.5%
Simplified30.5%
Taylor expanded in t around 0
/-lowering-/.f6429.7%
Simplified29.7%
(FPCore (x y z t) :precision binary64 -2.0)
double code(double x, double y, double z, double t) {
return -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 = -2.0d0
end function
public static double code(double x, double y, double z, double t) {
return -2.0;
}
def code(x, y, z, t): return -2.0
function code(x, y, z, t) return -2.0 end
function tmp = code(x, y, z, t) tmp = -2.0; end
code[x_, y_, z_, t_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 84.3%
+-lowering-+.f64N/A
/-lowering-/.f64N/A
sub-negN/A
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
distribute-rgt-neg-outN/A
unsub-negN/A
div-subN/A
sub-negN/A
+-lowering-+.f64N/A
Simplified98.7%
Taylor expanded in x around 0
Simplified61.1%
Taylor expanded in t around inf
Simplified20.4%
(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 2024192
(FPCore (x y z t)
:name "Data.HashTable.ST.Basic:computeOverhead from hashtables-1.2.0.2"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (/ 2 z) 2) t) (- 2 (/ x y))))
(+ (/ x y) (/ (+ 2.0 (* (* z 2.0) (- 1.0 t))) (* t z))))