
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (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 - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (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 - z)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
(FPCore (x y z t) :precision binary64 (* x (/ (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x * ((y - z) / (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 - z) / (t - z))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y - z) / (t - z));
}
def code(x, y, z, t): return x * ((y - z) / (t - z))
function code(x, y, z, t) return Float64(x * Float64(Float64(y - z) / Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x * ((y - z) / (t - z)); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y - z}{t - z}
\end{array}
Initial program 87.9%
*-commutative87.9%
associate-*l/97.6%
*-commutative97.6%
Simplified97.6%
Final simplification97.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))))
(if (<= z -7.2e+211)
x
(if (<= z -4.8e+172)
(* x (/ (- z) t))
(if (<= z -7.8e+39)
x
(if (<= z 6.5e+73)
t_1
(if (<= z 7.2e+99)
x
(if (<= z 1.7e+146)
t_1
(if (<= z 5e+241) (* x (+ (/ t z) 1.0)) x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (z <= -7.2e+211) {
tmp = x;
} else if (z <= -4.8e+172) {
tmp = x * (-z / t);
} else if (z <= -7.8e+39) {
tmp = x;
} else if (z <= 6.5e+73) {
tmp = t_1;
} else if (z <= 7.2e+99) {
tmp = x;
} else if (z <= 1.7e+146) {
tmp = t_1;
} else if (z <= 5e+241) {
tmp = x * ((t / z) + 1.0);
} else {
tmp = x;
}
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 / (t - z))
if (z <= (-7.2d+211)) then
tmp = x
else if (z <= (-4.8d+172)) then
tmp = x * (-z / t)
else if (z <= (-7.8d+39)) then
tmp = x
else if (z <= 6.5d+73) then
tmp = t_1
else if (z <= 7.2d+99) then
tmp = x
else if (z <= 1.7d+146) then
tmp = t_1
else if (z <= 5d+241) then
tmp = x * ((t / z) + 1.0d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (z <= -7.2e+211) {
tmp = x;
} else if (z <= -4.8e+172) {
tmp = x * (-z / t);
} else if (z <= -7.8e+39) {
tmp = x;
} else if (z <= 6.5e+73) {
tmp = t_1;
} else if (z <= 7.2e+99) {
tmp = x;
} else if (z <= 1.7e+146) {
tmp = t_1;
} else if (z <= 5e+241) {
tmp = x * ((t / z) + 1.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if z <= -7.2e+211: tmp = x elif z <= -4.8e+172: tmp = x * (-z / t) elif z <= -7.8e+39: tmp = x elif z <= 6.5e+73: tmp = t_1 elif z <= 7.2e+99: tmp = x elif z <= 1.7e+146: tmp = t_1 elif z <= 5e+241: tmp = x * ((t / z) + 1.0) else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(t - z))) tmp = 0.0 if (z <= -7.2e+211) tmp = x; elseif (z <= -4.8e+172) tmp = Float64(x * Float64(Float64(-z) / t)); elseif (z <= -7.8e+39) tmp = x; elseif (z <= 6.5e+73) tmp = t_1; elseif (z <= 7.2e+99) tmp = x; elseif (z <= 1.7e+146) tmp = t_1; elseif (z <= 5e+241) tmp = Float64(x * Float64(Float64(t / z) + 1.0)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / (t - z)); tmp = 0.0; if (z <= -7.2e+211) tmp = x; elseif (z <= -4.8e+172) tmp = x * (-z / t); elseif (z <= -7.8e+39) tmp = x; elseif (z <= 6.5e+73) tmp = t_1; elseif (z <= 7.2e+99) tmp = x; elseif (z <= 1.7e+146) tmp = t_1; elseif (z <= 5e+241) tmp = x * ((t / z) + 1.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+211], x, If[LessEqual[z, -4.8e+172], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.8e+39], x, If[LessEqual[z, 6.5e+73], t$95$1, If[LessEqual[z, 7.2e+99], x, If[LessEqual[z, 1.7e+146], t$95$1, If[LessEqual[z, 5e+241], N[(x * N[(N[(t / z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], x]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+211}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{+172}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+99}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+241}:\\
\;\;\;\;x \cdot \left(\frac{t}{z} + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.20000000000000006e211 or -4.8000000000000001e172 < z < -7.8000000000000002e39 or 6.5000000000000001e73 < z < 7.2000000000000003e99 or 5.00000000000000025e241 < z Initial program 79.9%
*-commutative79.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 69.6%
if -7.20000000000000006e211 < z < -4.8000000000000001e172Initial program 83.9%
*-commutative83.9%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in y around 0 84.3%
neg-mul-184.3%
distribute-neg-frac84.3%
Simplified84.3%
if -7.8000000000000002e39 < z < 6.5000000000000001e73 or 7.2000000000000003e99 < z < 1.69999999999999995e146Initial program 93.6%
*-commutative93.6%
associate-*l/96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in y around inf 73.8%
if 1.69999999999999995e146 < z < 5.00000000000000025e241Initial program 75.2%
*-commutative75.2%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 73.3%
mul-1-neg73.3%
associate-/l*98.0%
distribute-neg-frac98.0%
div-sub98.0%
*-inverses98.0%
Simplified98.0%
Taylor expanded in t around 0 62.5%
*-lft-identity62.5%
associate-/l*73.1%
associate-/r/72.6%
distribute-rgt-in72.6%
+-commutative72.6%
Simplified72.6%
Final simplification72.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- z) t))))
(if (<= z -7.2e+211)
x
(if (<= z -4.8e+172)
t_1
(if (<= z -215000000000.0)
x
(if (<= z -1.5e-26)
t_1
(if (<= z -2.5e-51)
x
(if (<= z -5.6e-285)
(* y (/ x t))
(if (<= z 3.3e+14) (* x (/ y t)) x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (-z / t);
double tmp;
if (z <= -7.2e+211) {
tmp = x;
} else if (z <= -4.8e+172) {
tmp = t_1;
} else if (z <= -215000000000.0) {
tmp = x;
} else if (z <= -1.5e-26) {
tmp = t_1;
} else if (z <= -2.5e-51) {
tmp = x;
} else if (z <= -5.6e-285) {
tmp = y * (x / t);
} else if (z <= 3.3e+14) {
tmp = x * (y / t);
} else {
tmp = x;
}
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 * (-z / t)
if (z <= (-7.2d+211)) then
tmp = x
else if (z <= (-4.8d+172)) then
tmp = t_1
else if (z <= (-215000000000.0d0)) then
tmp = x
else if (z <= (-1.5d-26)) then
tmp = t_1
else if (z <= (-2.5d-51)) then
tmp = x
else if (z <= (-5.6d-285)) then
tmp = y * (x / t)
else if (z <= 3.3d+14) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (-z / t);
double tmp;
if (z <= -7.2e+211) {
tmp = x;
} else if (z <= -4.8e+172) {
tmp = t_1;
} else if (z <= -215000000000.0) {
tmp = x;
} else if (z <= -1.5e-26) {
tmp = t_1;
} else if (z <= -2.5e-51) {
tmp = x;
} else if (z <= -5.6e-285) {
tmp = y * (x / t);
} else if (z <= 3.3e+14) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (-z / t) tmp = 0 if z <= -7.2e+211: tmp = x elif z <= -4.8e+172: tmp = t_1 elif z <= -215000000000.0: tmp = x elif z <= -1.5e-26: tmp = t_1 elif z <= -2.5e-51: tmp = x elif z <= -5.6e-285: tmp = y * (x / t) elif z <= 3.3e+14: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(-z) / t)) tmp = 0.0 if (z <= -7.2e+211) tmp = x; elseif (z <= -4.8e+172) tmp = t_1; elseif (z <= -215000000000.0) tmp = x; elseif (z <= -1.5e-26) tmp = t_1; elseif (z <= -2.5e-51) tmp = x; elseif (z <= -5.6e-285) tmp = Float64(y * Float64(x / t)); elseif (z <= 3.3e+14) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (-z / t); tmp = 0.0; if (z <= -7.2e+211) tmp = x; elseif (z <= -4.8e+172) tmp = t_1; elseif (z <= -215000000000.0) tmp = x; elseif (z <= -1.5e-26) tmp = t_1; elseif (z <= -2.5e-51) tmp = x; elseif (z <= -5.6e-285) tmp = y * (x / t); elseif (z <= 3.3e+14) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+211], x, If[LessEqual[z, -4.8e+172], t$95$1, If[LessEqual[z, -215000000000.0], x, If[LessEqual[z, -1.5e-26], t$95$1, If[LessEqual[z, -2.5e-51], x, If[LessEqual[z, -5.6e-285], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+14], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{-z}{t}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+211}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{+172}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -215000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-285}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.20000000000000006e211 or -4.8000000000000001e172 < z < -2.15e11 or -1.50000000000000006e-26 < z < -2.50000000000000002e-51 or 3.3e14 < z Initial program 83.2%
*-commutative83.2%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 61.5%
if -7.20000000000000006e211 < z < -4.8000000000000001e172 or -2.15e11 < z < -1.50000000000000006e-26Initial program 93.0%
*-commutative93.0%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 92.6%
Taylor expanded in y around 0 73.2%
neg-mul-173.2%
distribute-neg-frac73.2%
Simplified73.2%
if -2.50000000000000002e-51 < z < -5.59999999999999982e-285Initial program 92.0%
*-commutative92.0%
associate-*l/93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in z around 0 74.0%
associate-/l*75.9%
Simplified75.9%
associate-/r/81.8%
Applied egg-rr81.8%
if -5.59999999999999982e-285 < z < 3.3e14Initial program 93.4%
*-commutative93.4%
associate-*l/95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in z around 0 66.8%
Final simplification67.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -7.2e+211)
x
(if (<= z -4e+172)
(* x (/ (- z) t))
(if (<= z -3450000000000.0)
x
(if (<= z -5e-25)
(/ (- x) (/ t z))
(if (<= z -2.3e-51)
x
(if (<= z -1.15e-283)
(* y (/ x t))
(if (<= z 3.3e+14) (* x (/ y t)) x))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.2e+211) {
tmp = x;
} else if (z <= -4e+172) {
tmp = x * (-z / t);
} else if (z <= -3450000000000.0) {
tmp = x;
} else if (z <= -5e-25) {
tmp = -x / (t / z);
} else if (z <= -2.3e-51) {
tmp = x;
} else if (z <= -1.15e-283) {
tmp = y * (x / t);
} else if (z <= 3.3e+14) {
tmp = x * (y / t);
} else {
tmp = x;
}
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 <= (-7.2d+211)) then
tmp = x
else if (z <= (-4d+172)) then
tmp = x * (-z / t)
else if (z <= (-3450000000000.0d0)) then
tmp = x
else if (z <= (-5d-25)) then
tmp = -x / (t / z)
else if (z <= (-2.3d-51)) then
tmp = x
else if (z <= (-1.15d-283)) then
tmp = y * (x / t)
else if (z <= 3.3d+14) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.2e+211) {
tmp = x;
} else if (z <= -4e+172) {
tmp = x * (-z / t);
} else if (z <= -3450000000000.0) {
tmp = x;
} else if (z <= -5e-25) {
tmp = -x / (t / z);
} else if (z <= -2.3e-51) {
tmp = x;
} else if (z <= -1.15e-283) {
tmp = y * (x / t);
} else if (z <= 3.3e+14) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.2e+211: tmp = x elif z <= -4e+172: tmp = x * (-z / t) elif z <= -3450000000000.0: tmp = x elif z <= -5e-25: tmp = -x / (t / z) elif z <= -2.3e-51: tmp = x elif z <= -1.15e-283: tmp = y * (x / t) elif z <= 3.3e+14: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.2e+211) tmp = x; elseif (z <= -4e+172) tmp = Float64(x * Float64(Float64(-z) / t)); elseif (z <= -3450000000000.0) tmp = x; elseif (z <= -5e-25) tmp = Float64(Float64(-x) / Float64(t / z)); elseif (z <= -2.3e-51) tmp = x; elseif (z <= -1.15e-283) tmp = Float64(y * Float64(x / t)); elseif (z <= 3.3e+14) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -7.2e+211) tmp = x; elseif (z <= -4e+172) tmp = x * (-z / t); elseif (z <= -3450000000000.0) tmp = x; elseif (z <= -5e-25) tmp = -x / (t / z); elseif (z <= -2.3e-51) tmp = x; elseif (z <= -1.15e-283) tmp = y * (x / t); elseif (z <= 3.3e+14) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.2e+211], x, If[LessEqual[z, -4e+172], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3450000000000.0], x, If[LessEqual[z, -5e-25], N[((-x) / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-51], x, If[LessEqual[z, -1.15e-283], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+14], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+211}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+172}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -3450000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-25}:\\
\;\;\;\;\frac{-x}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-283}:\\
\;\;\;\;y \cdot \frac{x}{t}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.20000000000000006e211 or -4.0000000000000003e172 < z < -3.45e12 or -4.99999999999999962e-25 < z < -2.30000000000000002e-51 or 3.3e14 < z Initial program 83.2%
*-commutative83.2%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 61.5%
if -7.20000000000000006e211 < z < -4.0000000000000003e172Initial program 83.9%
*-commutative83.9%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in y around 0 84.3%
neg-mul-184.3%
distribute-neg-frac84.3%
Simplified84.3%
if -3.45e12 < z < -4.99999999999999962e-25Initial program 99.8%
*-commutative99.8%
associate-*l/99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in t around inf 87.0%
Taylor expanded in y around 0 65.1%
mul-1-neg65.1%
associate-/l*65.1%
distribute-neg-frac65.1%
Simplified65.1%
if -2.30000000000000002e-51 < z < -1.1499999999999999e-283Initial program 92.0%
*-commutative92.0%
associate-*l/93.9%
*-commutative93.9%
Simplified93.9%
Taylor expanded in z around 0 74.0%
associate-/l*75.9%
Simplified75.9%
associate-/r/81.8%
Applied egg-rr81.8%
if -1.1499999999999999e-283 < z < 3.3e14Initial program 93.4%
*-commutative93.4%
associate-*l/95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in z around 0 66.8%
Final simplification67.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.8e+36) (not (<= y 3e+37))) (* x (/ y (- t z))) (/ (- x) (+ (/ t z) -1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.8e+36) || !(y <= 3e+37)) {
tmp = x * (y / (t - z));
} else {
tmp = -x / ((t / z) + -1.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 ((y <= (-7.8d+36)) .or. (.not. (y <= 3d+37))) then
tmp = x * (y / (t - z))
else
tmp = -x / ((t / z) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.8e+36) || !(y <= 3e+37)) {
tmp = x * (y / (t - z));
} else {
tmp = -x / ((t / z) + -1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.8e+36) or not (y <= 3e+37): tmp = x * (y / (t - z)) else: tmp = -x / ((t / z) + -1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.8e+36) || !(y <= 3e+37)) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(Float64(-x) / Float64(Float64(t / z) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -7.8e+36) || ~((y <= 3e+37))) tmp = x * (y / (t - z)); else tmp = -x / ((t / z) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.8e+36], N[Not[LessEqual[y, 3e+37]], $MachinePrecision]], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x) / N[(N[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{+36} \lor \neg \left(y \leq 3 \cdot 10^{+37}\right):\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\frac{t}{z} + -1}\\
\end{array}
\end{array}
if y < -7.80000000000000042e36 or 3.00000000000000022e37 < y Initial program 89.1%
*-commutative89.1%
associate-*l/98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in y around inf 76.7%
if -7.80000000000000042e36 < y < 3.00000000000000022e37Initial program 87.0%
*-commutative87.0%
associate-*l/96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in y around 0 73.8%
mul-1-neg73.8%
associate-/l*84.6%
distribute-neg-frac84.6%
div-sub84.7%
*-inverses84.7%
Simplified84.7%
Final simplification81.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.05e+37) (not (<= y 1.4e+40))) (* x (/ y (- t z))) (* x (/ z (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.05e+37) || !(y <= 1.4e+40)) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.05d+37)) .or. (.not. (y <= 1.4d+40))) then
tmp = x * (y / (t - z))
else
tmp = x * (z / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.05e+37) || !(y <= 1.4e+40)) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.05e+37) or not (y <= 1.4e+40): tmp = x * (y / (t - z)) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.05e+37) || !(y <= 1.4e+40)) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = Float64(x * Float64(z / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.05e+37) || ~((y <= 1.4e+40))) tmp = x * (y / (t - z)); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.05e+37], N[Not[LessEqual[y, 1.4e+40]], $MachinePrecision]], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+37} \lor \neg \left(y \leq 1.4 \cdot 10^{+40}\right):\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -2.0499999999999999e37 or 1.4000000000000001e40 < y Initial program 89.1%
*-commutative89.1%
associate-*l/98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in y around inf 76.7%
if -2.0499999999999999e37 < y < 1.4000000000000001e40Initial program 87.0%
*-commutative87.0%
associate-*l/96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in y around 0 84.6%
neg-mul-184.6%
distribute-neg-frac84.6%
Simplified84.6%
frac-2neg84.6%
div-inv84.5%
remove-double-neg84.5%
sub-neg84.5%
distribute-neg-in84.5%
remove-double-neg84.5%
Applied egg-rr84.5%
associate-*r/84.6%
*-rgt-identity84.6%
+-commutative84.6%
unsub-neg84.6%
Simplified84.6%
Final simplification81.3%
(FPCore (x y z t) :precision binary64 (if (<= z -2.15e+38) x (if (<= z 3e+14) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.15e+38) {
tmp = x;
} else if (z <= 3e+14) {
tmp = x * (y / t);
} else {
tmp = x;
}
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 <= (-2.15d+38)) then
tmp = x
else if (z <= 3d+14) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.15e+38) {
tmp = x;
} else if (z <= 3e+14) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.15e+38: tmp = x elif z <= 3e+14: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.15e+38) tmp = x; elseif (z <= 3e+14) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.15e+38) tmp = x; elseif (z <= 3e+14) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.15e+38], x, If[LessEqual[z, 3e+14], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.1499999999999998e38 or 3e14 < z Initial program 82.2%
*-commutative82.2%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 59.5%
if -2.1499999999999998e38 < z < 3e14Initial program 93.7%
*-commutative93.7%
associate-*l/95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in z around 0 66.8%
Final simplification63.1%
(FPCore (x y z t) :precision binary64 (if (<= z -3.6e+37) x (if (<= z 3.3e+14) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+37) {
tmp = x;
} else if (z <= 3.3e+14) {
tmp = x / (t / y);
} else {
tmp = x;
}
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 <= (-3.6d+37)) then
tmp = x
else if (z <= 3.3d+14) then
tmp = x / (t / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.6e+37) {
tmp = x;
} else if (z <= 3.3e+14) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.6e+37: tmp = x elif z <= 3.3e+14: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.6e+37) tmp = x; elseif (z <= 3.3e+14) tmp = Float64(x / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.6e+37) tmp = x; elseif (z <= 3.3e+14) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.6e+37], x, If[LessEqual[z, 3.3e+14], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+37}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.59999999999999998e37 or 3.3e14 < z Initial program 82.2%
*-commutative82.2%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 59.5%
if -3.59999999999999998e37 < z < 3.3e14Initial program 93.7%
*-commutative93.7%
associate-*l/95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in z around 0 64.1%
associate-/l*66.8%
Simplified66.8%
Final simplification63.1%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 87.9%
*-commutative87.9%
associate-*l/97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in z around inf 35.1%
Final simplification35.1%
(FPCore (x y z t) :precision binary64 (/ x (/ (- t z) (- y z))))
double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - 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 / ((t - z) / (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x / ((t - z) / (y - z));
}
def code(x, y, z, t): return x / ((t - z) / (y - z))
function code(x, y, z, t) return Float64(x / Float64(Float64(t - z) / Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x / ((t - z) / (y - z)); end
code[x_, y_, z_, t_] := N[(x / N[(N[(t - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{t - z}{y - z}}
\end{array}
herbie shell --seed 2024013
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))