
(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 12 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 84.6%
associate-/l*96.1%
Simplified96.1%
Final simplification96.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -1.5e+44)
t_1
(if (<= z -270000000000.0)
(* x (/ (- z) t))
(if (or (<= z -5.5e-79) (not (<= z 1.76e-84))) t_1 (/ (* x y) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -1.5e+44) {
tmp = t_1;
} else if (z <= -270000000000.0) {
tmp = x * (-z / t);
} else if ((z <= -5.5e-79) || !(z <= 1.76e-84)) {
tmp = t_1;
} else {
tmp = (x * y) / 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) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - (y / z))
if (z <= (-1.5d+44)) then
tmp = t_1
else if (z <= (-270000000000.0d0)) then
tmp = x * (-z / t)
else if ((z <= (-5.5d-79)) .or. (.not. (z <= 1.76d-84))) then
tmp = t_1
else
tmp = (x * y) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -1.5e+44) {
tmp = t_1;
} else if (z <= -270000000000.0) {
tmp = x * (-z / t);
} else if ((z <= -5.5e-79) || !(z <= 1.76e-84)) {
tmp = t_1;
} else {
tmp = (x * y) / t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -1.5e+44: tmp = t_1 elif z <= -270000000000.0: tmp = x * (-z / t) elif (z <= -5.5e-79) or not (z <= 1.76e-84): tmp = t_1 else: tmp = (x * y) / t return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -1.5e+44) tmp = t_1; elseif (z <= -270000000000.0) tmp = Float64(x * Float64(Float64(-z) / t)); elseif ((z <= -5.5e-79) || !(z <= 1.76e-84)) tmp = t_1; else tmp = Float64(Float64(x * y) / t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -1.5e+44) tmp = t_1; elseif (z <= -270000000000.0) tmp = x * (-z / t); elseif ((z <= -5.5e-79) || ~((z <= 1.76e-84))) tmp = t_1; else tmp = (x * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+44], t$95$1, If[LessEqual[z, -270000000000.0], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -5.5e-79], N[Not[LessEqual[z, 1.76e-84]], $MachinePrecision]], t$95$1, N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -270000000000:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-79} \lor \neg \left(z \leq 1.76 \cdot 10^{-84}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\end{array}
\end{array}
if z < -1.49999999999999993e44 or -2.7e11 < z < -5.4999999999999997e-79 or 1.76e-84 < z Initial program 77.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 56.0%
mul-1-neg56.0%
associate-/l*73.5%
distribute-rgt-neg-in73.5%
distribute-frac-neg73.5%
neg-sub073.5%
associate--r-73.5%
neg-sub073.5%
+-commutative73.5%
sub-neg73.5%
div-sub73.5%
*-inverses73.5%
Simplified73.5%
if -1.49999999999999993e44 < z < -2.7e11Initial program 87.4%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in t around inf 78.2%
associate-/l*90.3%
Simplified90.3%
Taylor expanded in y around 0 55.0%
mul-1-neg55.0%
associate-/l*67.2%
distribute-rgt-neg-in67.2%
Simplified67.2%
if -5.4999999999999997e-79 < z < 1.76e-84Initial program 94.3%
associate-/l*90.8%
Simplified90.8%
Taylor expanded in z around 0 80.0%
Final simplification76.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ z (- z t)))) (t_2 (* x (/ y (- t z)))))
(if (<= y -7.5e+127)
t_2
(if (<= y -1.1e-45)
t_1
(if (<= y -6e-115) (* x (/ (- y z) t)) (if (<= y 5.5e+22) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z / (z - t));
double t_2 = x * (y / (t - z));
double tmp;
if (y <= -7.5e+127) {
tmp = t_2;
} else if (y <= -1.1e-45) {
tmp = t_1;
} else if (y <= -6e-115) {
tmp = x * ((y - z) / t);
} else if (y <= 5.5e+22) {
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 * (z / (z - t))
t_2 = x * (y / (t - z))
if (y <= (-7.5d+127)) then
tmp = t_2
else if (y <= (-1.1d-45)) then
tmp = t_1
else if (y <= (-6d-115)) then
tmp = x * ((y - z) / t)
else if (y <= 5.5d+22) 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 * (z / (z - t));
double t_2 = x * (y / (t - z));
double tmp;
if (y <= -7.5e+127) {
tmp = t_2;
} else if (y <= -1.1e-45) {
tmp = t_1;
} else if (y <= -6e-115) {
tmp = x * ((y - z) / t);
} else if (y <= 5.5e+22) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z / (z - t)) t_2 = x * (y / (t - z)) tmp = 0 if y <= -7.5e+127: tmp = t_2 elif y <= -1.1e-45: tmp = t_1 elif y <= -6e-115: tmp = x * ((y - z) / t) elif y <= 5.5e+22: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z / Float64(z - t))) t_2 = Float64(x * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -7.5e+127) tmp = t_2; elseif (y <= -1.1e-45) tmp = t_1; elseif (y <= -6e-115) tmp = Float64(x * Float64(Float64(y - z) / t)); elseif (y <= 5.5e+22) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z / (z - t)); t_2 = x * (y / (t - z)); tmp = 0.0; if (y <= -7.5e+127) tmp = t_2; elseif (y <= -1.1e-45) tmp = t_1; elseif (y <= -6e-115) tmp = x * ((y - z) / t); elseif (y <= 5.5e+22) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.5e+127], t$95$2, If[LessEqual[y, -1.1e-45], t$95$1, If[LessEqual[y, -6e-115], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e+22], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{z - t}\\
t_2 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+127}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-115}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -7.4999999999999996e127 or 5.50000000000000021e22 < y Initial program 91.2%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in y around inf 86.0%
associate-/l*87.0%
Simplified87.0%
if -7.4999999999999996e127 < y < -1.09999999999999997e-45 or -6.0000000000000003e-115 < y < 5.50000000000000021e22Initial program 80.7%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around 0 59.9%
mul-1-neg59.9%
distribute-neg-frac259.9%
neg-sub059.9%
associate--r-59.9%
neg-sub059.9%
+-commutative59.9%
sub-neg59.9%
associate-/l*78.2%
Simplified78.2%
if -1.09999999999999997e-45 < y < -6.0000000000000003e-115Initial program 77.5%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in t around inf 65.8%
associate-/l*76.5%
Simplified76.5%
Final simplification81.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ y (- t z)))))
(if (<= y -7.5e+127)
t_1
(if (<= y -1.5e-45)
(/ x (- 1.0 (/ t z)))
(if (<= y -7.8e-115)
(* x (/ (- y z) t))
(if (<= y 6.5e+20) (* x (/ z (- z t))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (y <= -7.5e+127) {
tmp = t_1;
} else if (y <= -1.5e-45) {
tmp = x / (1.0 - (t / z));
} else if (y <= -7.8e-115) {
tmp = x * ((y - z) / t);
} else if (y <= 6.5e+20) {
tmp = x * (z / (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 / (t - z))
if (y <= (-7.5d+127)) then
tmp = t_1
else if (y <= (-1.5d-45)) then
tmp = x / (1.0d0 - (t / z))
else if (y <= (-7.8d-115)) then
tmp = x * ((y - z) / t)
else if (y <= 6.5d+20) then
tmp = x * (z / (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 / (t - z));
double tmp;
if (y <= -7.5e+127) {
tmp = t_1;
} else if (y <= -1.5e-45) {
tmp = x / (1.0 - (t / z));
} else if (y <= -7.8e-115) {
tmp = x * ((y - z) / t);
} else if (y <= 6.5e+20) {
tmp = x * (z / (z - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if y <= -7.5e+127: tmp = t_1 elif y <= -1.5e-45: tmp = x / (1.0 - (t / z)) elif y <= -7.8e-115: tmp = x * ((y - z) / t) elif y <= 6.5e+20: tmp = x * (z / (z - t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -7.5e+127) tmp = t_1; elseif (y <= -1.5e-45) tmp = Float64(x / Float64(1.0 - Float64(t / z))); elseif (y <= -7.8e-115) tmp = Float64(x * Float64(Float64(y - z) / t)); elseif (y <= 6.5e+20) tmp = Float64(x * Float64(z / Float64(z - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / (t - z)); tmp = 0.0; if (y <= -7.5e+127) tmp = t_1; elseif (y <= -1.5e-45) tmp = x / (1.0 - (t / z)); elseif (y <= -7.8e-115) tmp = x * ((y - z) / t); elseif (y <= 6.5e+20) tmp = x * (z / (z - t)); else tmp = t_1; 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[y, -7.5e+127], t$95$1, If[LessEqual[y, -1.5e-45], N[(x / N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.8e-115], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e+20], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-45}:\\
\;\;\;\;\frac{x}{1 - \frac{t}{z}}\\
\mathbf{elif}\;y \leq -7.8 \cdot 10^{-115}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+20}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.4999999999999996e127 or 6.5e20 < y Initial program 91.2%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in y around inf 86.0%
associate-/l*87.0%
Simplified87.0%
if -7.4999999999999996e127 < y < -1.50000000000000005e-45Initial program 79.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 54.5%
mul-1-neg54.5%
distribute-neg-frac254.5%
neg-sub054.5%
associate--r-54.5%
neg-sub054.5%
+-commutative54.5%
sub-neg54.5%
associate-/l*75.3%
Simplified75.3%
Taylor expanded in x around 0 54.5%
associate-*l/64.2%
associate-/r/75.3%
div-sub75.3%
*-inverses75.3%
Simplified75.3%
if -1.50000000000000005e-45 < y < -7.7999999999999997e-115Initial program 77.5%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in t around inf 65.8%
associate-/l*76.5%
Simplified76.5%
if -7.7999999999999997e-115 < y < 6.5e20Initial program 81.2%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in y around 0 61.5%
mul-1-neg61.5%
distribute-neg-frac261.5%
neg-sub061.5%
associate--r-61.5%
neg-sub061.5%
+-commutative61.5%
sub-neg61.5%
associate-/l*79.1%
Simplified79.1%
Final simplification81.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= z -1.12e+58)
t_1
(if (<= z -215000000000.0)
(* x (/ (- y z) t))
(if (<= z -2.2e-6)
t_1
(if (<= z 2.7e+31) (/ (* x y) (- t z)) (* x (/ z (- z t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -1.12e+58) {
tmp = t_1;
} else if (z <= -215000000000.0) {
tmp = x * ((y - z) / t);
} else if (z <= -2.2e-6) {
tmp = t_1;
} else if (z <= 2.7e+31) {
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) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - (y / z))
if (z <= (-1.12d+58)) then
tmp = t_1
else if (z <= (-215000000000.0d0)) then
tmp = x * ((y - z) / t)
else if (z <= (-2.2d-6)) then
tmp = t_1
else if (z <= 2.7d+31) 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 t_1 = x * (1.0 - (y / z));
double tmp;
if (z <= -1.12e+58) {
tmp = t_1;
} else if (z <= -215000000000.0) {
tmp = x * ((y - z) / t);
} else if (z <= -2.2e-6) {
tmp = t_1;
} else if (z <= 2.7e+31) {
tmp = (x * y) / (t - z);
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if z <= -1.12e+58: tmp = t_1 elif z <= -215000000000.0: tmp = x * ((y - z) / t) elif z <= -2.2e-6: tmp = t_1 elif z <= 2.7e+31: tmp = (x * y) / (t - z) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (z <= -1.12e+58) tmp = t_1; elseif (z <= -215000000000.0) tmp = Float64(x * Float64(Float64(y - z) / t)); elseif (z <= -2.2e-6) tmp = t_1; elseif (z <= 2.7e+31) tmp = Float64(Float64(x * 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) t_1 = x * (1.0 - (y / z)); tmp = 0.0; if (z <= -1.12e+58) tmp = t_1; elseif (z <= -215000000000.0) tmp = x * ((y - z) / t); elseif (z <= -2.2e-6) tmp = t_1; elseif (z <= 2.7e+31) tmp = (x * y) / (t - z); else tmp = x * (z / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.12e+58], t$95$1, If[LessEqual[z, -215000000000.0], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.2e-6], t$95$1, If[LessEqual[z, 2.7e+31], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -1.12 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -215000000000:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+31}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if z < -1.12e58 or -2.15e11 < z < -2.2000000000000001e-6Initial program 72.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 64.6%
mul-1-neg64.6%
associate-/l*87.1%
distribute-rgt-neg-in87.1%
distribute-frac-neg87.1%
neg-sub087.1%
associate--r-87.1%
neg-sub087.1%
+-commutative87.1%
sub-neg87.1%
div-sub87.1%
*-inverses87.1%
Simplified87.1%
if -1.12e58 < z < -2.15e11Initial program 88.8%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t around inf 80.6%
associate-/l*91.4%
Simplified91.4%
if -2.2000000000000001e-6 < z < 2.69999999999999986e31Initial program 94.2%
associate-/l*92.8%
Simplified92.8%
Taylor expanded in y around inf 81.7%
if 2.69999999999999986e31 < z Initial program 71.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 52.9%
mul-1-neg52.9%
distribute-neg-frac252.9%
neg-sub052.9%
associate--r-52.9%
neg-sub052.9%
+-commutative52.9%
sub-neg52.9%
associate-/l*80.8%
Simplified80.8%
Final simplification83.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.5e+129)
x
(if (<= z -3.5e+93)
(* x (/ y (- z)))
(if (<= z -3e+58) x (if (<= z 6e+45) (/ (* x y) t) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.5e+129) {
tmp = x;
} else if (z <= -3.5e+93) {
tmp = x * (y / -z);
} else if (z <= -3e+58) {
tmp = x;
} else if (z <= 6e+45) {
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.5d+129)) then
tmp = x
else if (z <= (-3.5d+93)) then
tmp = x * (y / -z)
else if (z <= (-3d+58)) then
tmp = x
else if (z <= 6d+45) 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.5e+129) {
tmp = x;
} else if (z <= -3.5e+93) {
tmp = x * (y / -z);
} else if (z <= -3e+58) {
tmp = x;
} else if (z <= 6e+45) {
tmp = (x * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.5e+129: tmp = x elif z <= -3.5e+93: tmp = x * (y / -z) elif z <= -3e+58: tmp = x elif z <= 6e+45: tmp = (x * y) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.5e+129) tmp = x; elseif (z <= -3.5e+93) tmp = Float64(x * Float64(y / Float64(-z))); elseif (z <= -3e+58) tmp = x; elseif (z <= 6e+45) tmp = Float64(Float64(x * y) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.5e+129) tmp = x; elseif (z <= -3.5e+93) tmp = x * (y / -z); elseif (z <= -3e+58) tmp = x; elseif (z <= 6e+45) tmp = (x * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.5e+129], x, If[LessEqual[z, -3.5e+93], N[(x * N[(y / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3e+58], x, If[LessEqual[z, 6e+45], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+129}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{+93}:\\
\;\;\;\;x \cdot \frac{y}{-z}\\
\mathbf{elif}\;z \leq -3 \cdot 10^{+58}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+45}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.5000000000000001e129 or -3.49999999999999998e93 < z < -3.0000000000000002e58 or 6.00000000000000021e45 < z Initial program 67.6%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 74.4%
if -2.5000000000000001e129 < z < -3.49999999999999998e93Initial program 100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 80.6%
mul-1-neg80.6%
associate-/l*80.6%
distribute-rgt-neg-in80.6%
distribute-frac-neg80.6%
neg-sub080.6%
associate--r-80.6%
neg-sub080.6%
+-commutative80.6%
sub-neg80.6%
div-sub80.6%
*-inverses80.6%
Simplified80.6%
Taylor expanded in y around inf 70.7%
associate-*r/70.7%
mul-1-neg70.7%
distribute-rgt-neg-in70.7%
associate-*r/70.7%
Simplified70.7%
if -3.0000000000000002e58 < z < 6.00000000000000021e45Initial program 94.1%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in z around 0 67.6%
Final simplification70.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.7e+58) (not (<= z 1.9e+46))) (* x (- 1.0 (/ y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e+58) || !(z <= 1.9e+46)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.7d+58)) .or. (.not. (z <= 1.9d+46))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x * (y / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.7e+58) || !(z <= 1.9e+46)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x * (y / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.7e+58) or not (z <= 1.9e+46): tmp = x * (1.0 - (y / z)) else: tmp = x * (y / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.7e+58) || !(z <= 1.9e+46)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x * Float64(y / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.7e+58) || ~((z <= 1.9e+46))) tmp = x * (1.0 - (y / z)); else tmp = x * (y / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.7e+58], N[Not[LessEqual[z, 1.9e+46]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+58} \lor \neg \left(z \leq 1.9 \cdot 10^{+46}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -1.7e58 or 1.9e46 < z Initial program 70.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 57.8%
mul-1-neg57.8%
associate-/l*81.7%
distribute-rgt-neg-in81.7%
distribute-frac-neg81.7%
neg-sub081.7%
associate--r-81.7%
neg-sub081.7%
+-commutative81.7%
sub-neg81.7%
div-sub81.6%
*-inverses81.6%
Simplified81.6%
if -1.7e58 < z < 1.9e46Initial program 94.1%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in y around inf 78.5%
associate-/l*76.0%
Simplified76.0%
Final simplification78.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -7.5e+127) (not (<= y 1.1e+14))) (* x (/ y (- t z))) (* x (/ z (- z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -7.5e+127) || !(y <= 1.1e+14)) {
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 <= (-7.5d+127)) .or. (.not. (y <= 1.1d+14))) 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 <= -7.5e+127) || !(y <= 1.1e+14)) {
tmp = x * (y / (t - z));
} else {
tmp = x * (z / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -7.5e+127) or not (y <= 1.1e+14): tmp = x * (y / (t - z)) else: tmp = x * (z / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -7.5e+127) || !(y <= 1.1e+14)) 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 <= -7.5e+127) || ~((y <= 1.1e+14))) 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, -7.5e+127], N[Not[LessEqual[y, 1.1e+14]], $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 -7.5 \cdot 10^{+127} \lor \neg \left(y \leq 1.1 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{z - t}\\
\end{array}
\end{array}
if y < -7.4999999999999996e127 or 1.1e14 < y Initial program 91.2%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in y around inf 86.0%
associate-/l*87.0%
Simplified87.0%
if -7.4999999999999996e127 < y < 1.1e14Initial program 80.3%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 56.7%
mul-1-neg56.7%
distribute-neg-frac256.7%
neg-sub056.7%
associate--r-56.7%
neg-sub056.7%
+-commutative56.7%
sub-neg56.7%
associate-/l*74.9%
Simplified74.9%
Final simplification79.6%
(FPCore (x y z t) :precision binary64 (if (<= z -1e+59) x (if (<= z 1.05e+46) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1e+59) {
tmp = x;
} else if (z <= 1.05e+46) {
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 <= (-1d+59)) then
tmp = x
else if (z <= 1.05d+46) 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 <= -1e+59) {
tmp = x;
} else if (z <= 1.05e+46) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1e+59: tmp = x elif z <= 1.05e+46: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1e+59) tmp = x; elseif (z <= 1.05e+46) 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 <= -1e+59) tmp = x; elseif (z <= 1.05e+46) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1e+59], x, If[LessEqual[z, 1.05e+46], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+59}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+46}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.99999999999999972e58 or 1.05e46 < z Initial program 70.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 68.3%
if -9.99999999999999972e58 < z < 1.05e46Initial program 94.1%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in z around 0 67.6%
associate-/l*65.7%
Simplified65.7%
Final simplification66.8%
(FPCore (x y z t) :precision binary64 (if (<= z -3e+58) x (if (<= z 5.3e+45) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3e+58) {
tmp = x;
} else if (z <= 5.3e+45) {
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 <= (-3d+58)) then
tmp = x
else if (z <= 5.3d+45) 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 <= -3e+58) {
tmp = x;
} else if (z <= 5.3e+45) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3e+58: tmp = x elif z <= 5.3e+45: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3e+58) tmp = x; elseif (z <= 5.3e+45) 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 <= -3e+58) tmp = x; elseif (z <= 5.3e+45) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3e+58], x, If[LessEqual[z, 5.3e+45], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+58}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+45}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.0000000000000002e58 or 5.29999999999999991e45 < z Initial program 70.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 68.3%
if -3.0000000000000002e58 < z < 5.29999999999999991e45Initial program 94.1%
associate-/l*93.5%
Simplified93.5%
clear-num92.9%
un-div-inv93.5%
Applied egg-rr93.5%
Taylor expanded in z around 0 66.4%
Final simplification67.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.35e+57) x (if (<= z 2e+46) (/ (* x y) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e+57) {
tmp = x;
} else if (z <= 2e+46) {
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 <= (-1.35d+57)) then
tmp = x
else if (z <= 2d+46) 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 <= -1.35e+57) {
tmp = x;
} else if (z <= 2e+46) {
tmp = (x * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.35e+57: tmp = x elif z <= 2e+46: tmp = (x * y) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.35e+57) tmp = x; elseif (z <= 2e+46) tmp = Float64(Float64(x * y) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.35e+57) tmp = x; elseif (z <= 2e+46) tmp = (x * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e+57], x, If[LessEqual[z, 2e+46], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+57}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+46}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.3499999999999999e57 or 2e46 < z Initial program 70.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 68.3%
if -1.3499999999999999e57 < z < 2e46Initial program 94.1%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in z around 0 67.6%
Final simplification67.9%
(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 84.6%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around inf 33.1%
Final simplification33.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 2024067
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))