
(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 82.2%
*-commutative82.2%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))) (t_2 (* x (/ (- y z) t))))
(if (<= t -2.3e-6)
t_2
(if (<= t 2.4e-98)
t_1
(if (<= t 2.7e-54) (* x (/ y (- t z))) (if (<= t 3.0) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double t_2 = x * ((y - z) / t);
double tmp;
if (t <= -2.3e-6) {
tmp = t_2;
} else if (t <= 2.4e-98) {
tmp = t_1;
} else if (t <= 2.7e-54) {
tmp = x * (y / (t - z));
} else if (t <= 3.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (1.0d0 - (y / z))
t_2 = x * ((y - z) / t)
if (t <= (-2.3d-6)) then
tmp = t_2
else if (t <= 2.4d-98) then
tmp = t_1
else if (t <= 2.7d-54) then
tmp = x * (y / (t - z))
else if (t <= 3.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double t_2 = x * ((y - z) / t);
double tmp;
if (t <= -2.3e-6) {
tmp = t_2;
} else if (t <= 2.4e-98) {
tmp = t_1;
} else if (t <= 2.7e-54) {
tmp = x * (y / (t - z));
} else if (t <= 3.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) t_2 = x * ((y - z) / t) tmp = 0 if t <= -2.3e-6: tmp = t_2 elif t <= 2.4e-98: tmp = t_1 elif t <= 2.7e-54: tmp = x * (y / (t - z)) elif t <= 3.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) t_2 = Float64(x * Float64(Float64(y - z) / t)) tmp = 0.0 if (t <= -2.3e-6) tmp = t_2; elseif (t <= 2.4e-98) tmp = t_1; elseif (t <= 2.7e-54) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (t <= 3.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / z)); t_2 = x * ((y - z) / t); tmp = 0.0; if (t <= -2.3e-6) tmp = t_2; elseif (t <= 2.4e-98) tmp = t_1; elseif (t <= 2.7e-54) tmp = x * (y / (t - z)); elseif (t <= 3.0) tmp = t_1; else tmp = t_2; 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]}, Block[{t$95$2 = N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.3e-6], t$95$2, If[LessEqual[t, 2.4e-98], t$95$1, If[LessEqual[t, 2.7e-54], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
t_2 := x \cdot \frac{y - z}{t}\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{-6}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-54}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;t \leq 3:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.3e-6 or 3 < t Initial program 83.2%
*-commutative83.2%
associate-*l/98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in t around inf 80.9%
if -2.3e-6 < t < 2.40000000000000005e-98 or 2.70000000000000026e-54 < t < 3Initial program 81.6%
*-commutative81.6%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in t around 0 85.1%
mul-1-neg85.1%
div-sub85.1%
sub-neg85.1%
*-inverses85.1%
metadata-eval85.1%
Simplified85.1%
Taylor expanded in x around 0 85.1%
if 2.40000000000000005e-98 < t < 2.70000000000000026e-54Initial program 78.4%
*-commutative78.4%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 85.2%
Final simplification83.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= t -5.1e-9)
(/ x (/ t (- y z)))
(if (<= t 1.7e-97)
t_1
(if (<= t 4.2e-54)
(* x (/ y (- t z)))
(if (<= t 4.4) t_1 (* x (/ (- y z) t))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (t <= -5.1e-9) {
tmp = x / (t / (y - z));
} else if (t <= 1.7e-97) {
tmp = t_1;
} else if (t <= 4.2e-54) {
tmp = x * (y / (t - z));
} else if (t <= 4.4) {
tmp = t_1;
} else {
tmp = x * ((y - 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 (t <= (-5.1d-9)) then
tmp = x / (t / (y - z))
else if (t <= 1.7d-97) then
tmp = t_1
else if (t <= 4.2d-54) then
tmp = x * (y / (t - z))
else if (t <= 4.4d0) then
tmp = t_1
else
tmp = x * ((y - 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 (t <= -5.1e-9) {
tmp = x / (t / (y - z));
} else if (t <= 1.7e-97) {
tmp = t_1;
} else if (t <= 4.2e-54) {
tmp = x * (y / (t - z));
} else if (t <= 4.4) {
tmp = t_1;
} else {
tmp = x * ((y - z) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if t <= -5.1e-9: tmp = x / (t / (y - z)) elif t <= 1.7e-97: tmp = t_1 elif t <= 4.2e-54: tmp = x * (y / (t - z)) elif t <= 4.4: tmp = t_1 else: tmp = x * ((y - z) / t) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (t <= -5.1e-9) tmp = Float64(x / Float64(t / Float64(y - z))); elseif (t <= 1.7e-97) tmp = t_1; elseif (t <= 4.2e-54) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (t <= 4.4) tmp = t_1; else tmp = Float64(x * Float64(Float64(y - 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 (t <= -5.1e-9) tmp = x / (t / (y - z)); elseif (t <= 1.7e-97) tmp = t_1; elseif (t <= 4.2e-54) tmp = x * (y / (t - z)); elseif (t <= 4.4) tmp = t_1; else tmp = x * ((y - 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[t, -5.1e-9], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e-97], t$95$1, If[LessEqual[t, 4.2e-54], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4], t$95$1, N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;t \leq -5.1 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-54}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;t \leq 4.4:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if t < -5.10000000000000017e-9Initial program 74.5%
*-commutative74.5%
associate-*l/98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in t around inf 58.6%
associate-/l*74.5%
Simplified74.5%
if -5.10000000000000017e-9 < t < 1.6999999999999999e-97 or 4.2e-54 < t < 4.4000000000000004Initial program 81.6%
*-commutative81.6%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in t around 0 85.1%
mul-1-neg85.1%
div-sub85.1%
sub-neg85.1%
*-inverses85.1%
metadata-eval85.1%
Simplified85.1%
Taylor expanded in x around 0 85.1%
if 1.6999999999999999e-97 < t < 4.2e-54Initial program 78.4%
*-commutative78.4%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 85.2%
if 4.4000000000000004 < t Initial program 90.6%
*-commutative90.6%
associate-*l/97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in t around inf 86.4%
Final simplification83.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y z)))))
(if (<= t -2.3e-10)
(/ x (/ t (- y z)))
(if (<= t 1.7e-97)
t_1
(if (<= t 8.5e-54)
(/ x (/ (- t z) y))
(if (<= t 5.6) t_1 (* x (/ (- y z) t))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / z));
double tmp;
if (t <= -2.3e-10) {
tmp = x / (t / (y - z));
} else if (t <= 1.7e-97) {
tmp = t_1;
} else if (t <= 8.5e-54) {
tmp = x / ((t - z) / y);
} else if (t <= 5.6) {
tmp = t_1;
} else {
tmp = x * ((y - 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 (t <= (-2.3d-10)) then
tmp = x / (t / (y - z))
else if (t <= 1.7d-97) then
tmp = t_1
else if (t <= 8.5d-54) then
tmp = x / ((t - z) / y)
else if (t <= 5.6d0) then
tmp = t_1
else
tmp = x * ((y - 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 (t <= -2.3e-10) {
tmp = x / (t / (y - z));
} else if (t <= 1.7e-97) {
tmp = t_1;
} else if (t <= 8.5e-54) {
tmp = x / ((t - z) / y);
} else if (t <= 5.6) {
tmp = t_1;
} else {
tmp = x * ((y - z) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / z)) tmp = 0 if t <= -2.3e-10: tmp = x / (t / (y - z)) elif t <= 1.7e-97: tmp = t_1 elif t <= 8.5e-54: tmp = x / ((t - z) / y) elif t <= 5.6: tmp = t_1 else: tmp = x * ((y - z) / t) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / z))) tmp = 0.0 if (t <= -2.3e-10) tmp = Float64(x / Float64(t / Float64(y - z))); elseif (t <= 1.7e-97) tmp = t_1; elseif (t <= 8.5e-54) tmp = Float64(x / Float64(Float64(t - z) / y)); elseif (t <= 5.6) tmp = t_1; else tmp = Float64(x * Float64(Float64(y - 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 (t <= -2.3e-10) tmp = x / (t / (y - z)); elseif (t <= 1.7e-97) tmp = t_1; elseif (t <= 8.5e-54) tmp = x / ((t - z) / y); elseif (t <= 5.6) tmp = t_1; else tmp = x * ((y - 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[t, -2.3e-10], N[(x / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e-97], t$95$1, If[LessEqual[t, 8.5e-54], N[(x / N[(N[(t - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6], t$95$1, N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{-10}:\\
\;\;\;\;\frac{x}{\frac{t}{y - z}}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-54}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y}}\\
\mathbf{elif}\;t \leq 5.6:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if t < -2.30000000000000007e-10Initial program 74.5%
*-commutative74.5%
associate-*l/98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in t around inf 58.6%
associate-/l*74.5%
Simplified74.5%
if -2.30000000000000007e-10 < t < 1.6999999999999999e-97 or 8.5e-54 < t < 5.5999999999999996Initial program 81.6%
*-commutative81.6%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in t around 0 85.1%
mul-1-neg85.1%
div-sub85.1%
sub-neg85.1%
*-inverses85.1%
metadata-eval85.1%
Simplified85.1%
Taylor expanded in x around 0 85.1%
if 1.6999999999999999e-97 < t < 8.5e-54Initial program 78.4%
*-commutative78.4%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 73.8%
associate-/l*85.4%
Simplified85.4%
if 5.5999999999999996 < t Initial program 90.6%
*-commutative90.6%
associate-*l/97.8%
*-commutative97.8%
Simplified97.8%
Taylor expanded in t around inf 86.4%
Final simplification83.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.24e-14) x (if (<= z 1.6e-30) (/ x (/ t y)) (if (<= z 5.5e+122) (/ (* x (- y)) z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.24e-14) {
tmp = x;
} else if (z <= 1.6e-30) {
tmp = x / (t / y);
} else if (z <= 5.5e+122) {
tmp = (x * -y) / z;
} 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.24d-14)) then
tmp = x
else if (z <= 1.6d-30) then
tmp = x / (t / y)
else if (z <= 5.5d+122) then
tmp = (x * -y) / z
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.24e-14) {
tmp = x;
} else if (z <= 1.6e-30) {
tmp = x / (t / y);
} else if (z <= 5.5e+122) {
tmp = (x * -y) / z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.24e-14: tmp = x elif z <= 1.6e-30: tmp = x / (t / y) elif z <= 5.5e+122: tmp = (x * -y) / z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.24e-14) tmp = x; elseif (z <= 1.6e-30) tmp = Float64(x / Float64(t / y)); elseif (z <= 5.5e+122) tmp = Float64(Float64(x * Float64(-y)) / z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.24e-14) tmp = x; elseif (z <= 1.6e-30) tmp = x / (t / y); elseif (z <= 5.5e+122) tmp = (x * -y) / z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.24e-14], x, If[LessEqual[z, 1.6e-30], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e+122], N[(N[(x * (-y)), $MachinePrecision] / z), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.24 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-30}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+122}:\\
\;\;\;\;\frac{x \cdot \left(-y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.24e-14 or 5.4999999999999998e122 < z Initial program 73.9%
*-commutative73.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 63.7%
if -1.24e-14 < z < 1.6e-30Initial program 90.8%
*-commutative90.8%
associate-*l/95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in z around 0 68.9%
associate-/l*74.4%
Simplified74.4%
if 1.6e-30 < z < 5.4999999999999998e122Initial program 83.8%
*-commutative83.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 56.4%
associate-/l*72.2%
Simplified72.2%
Taylor expanded in t around 0 53.1%
neg-mul-153.1%
distribute-neg-frac53.1%
Simplified53.1%
frac-2neg53.1%
distribute-frac-neg53.1%
add-sqr-sqrt29.1%
sqrt-unprod25.1%
sqr-neg25.1%
sqrt-unprod3.9%
add-sqr-sqrt8.5%
frac-2neg8.5%
associate-/r/8.5%
associate-*l/8.5%
add-sqr-sqrt0.0%
sqrt-unprod45.4%
sqr-neg45.4%
sqrt-unprod45.2%
add-sqr-sqrt45.4%
Applied egg-rr45.4%
Final simplification65.6%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.8e-15)
x
(if (<= z 1.48e-30)
(/ x (/ t y))
(if (<= z 4.8e+122) (* x (/ (- y) z)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.8e-15) {
tmp = x;
} else if (z <= 1.48e-30) {
tmp = x / (t / y);
} else if (z <= 4.8e+122) {
tmp = x * (-y / z);
} 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 <= (-4.8d-15)) then
tmp = x
else if (z <= 1.48d-30) then
tmp = x / (t / y)
else if (z <= 4.8d+122) then
tmp = x * (-y / z)
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 <= -4.8e-15) {
tmp = x;
} else if (z <= 1.48e-30) {
tmp = x / (t / y);
} else if (z <= 4.8e+122) {
tmp = x * (-y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.8e-15: tmp = x elif z <= 1.48e-30: tmp = x / (t / y) elif z <= 4.8e+122: tmp = x * (-y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.8e-15) tmp = x; elseif (z <= 1.48e-30) tmp = Float64(x / Float64(t / y)); elseif (z <= 4.8e+122) tmp = Float64(x * Float64(Float64(-y) / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.8e-15) tmp = x; elseif (z <= 1.48e-30) tmp = x / (t / y); elseif (z <= 4.8e+122) tmp = x * (-y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.8e-15], x, If[LessEqual[z, 1.48e-30], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+122], N[(x * N[((-y) / z), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-15}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.48 \cdot 10^{-30}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+122}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.7999999999999999e-15 or 4.8000000000000004e122 < z Initial program 73.9%
*-commutative73.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 63.7%
if -4.7999999999999999e-15 < z < 1.4799999999999999e-30Initial program 90.8%
*-commutative90.8%
associate-*l/95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in z around 0 68.9%
associate-/l*74.4%
Simplified74.4%
if 1.4799999999999999e-30 < z < 4.8000000000000004e122Initial program 83.8%
*-commutative83.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 72.3%
Taylor expanded in t around 0 45.4%
mul-1-neg45.4%
associate-*r/53.2%
*-commutative53.2%
distribute-rgt-neg-in53.2%
Simplified53.2%
Final simplification66.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.2e-6) (not (<= z 4.2e+122))) (/ (- x) (+ (/ t z) -1.0)) (* y (/ x (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e-6) || !(z <= 4.2e+122)) {
tmp = -x / ((t / z) + -1.0);
} else {
tmp = y * (x / (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 <= (-2.2d-6)) .or. (.not. (z <= 4.2d+122))) then
tmp = -x / ((t / z) + (-1.0d0))
else
tmp = y * (x / (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.2e-6) || !(z <= 4.2e+122)) {
tmp = -x / ((t / z) + -1.0);
} else {
tmp = y * (x / (t - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.2e-6) or not (z <= 4.2e+122): tmp = -x / ((t / z) + -1.0) else: tmp = y * (x / (t - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.2e-6) || !(z <= 4.2e+122)) tmp = Float64(Float64(-x) / Float64(Float64(t / z) + -1.0)); else tmp = Float64(y * Float64(x / Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.2e-6) || ~((z <= 4.2e+122))) tmp = -x / ((t / z) + -1.0); else tmp = y * (x / (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.2e-6], N[Not[LessEqual[z, 4.2e+122]], $MachinePrecision]], N[((-x) / N[(N[(t / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-6} \lor \neg \left(z \leq 4.2 \cdot 10^{+122}\right):\\
\;\;\;\;\frac{-x}{\frac{t}{z} + -1}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{t - z}\\
\end{array}
\end{array}
if z < -2.2000000000000001e-6 or 4.20000000000000032e122 < z Initial program 73.4%
*-commutative73.4%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 64.0%
mul-1-neg64.0%
associate-/l*84.7%
distribute-neg-frac84.7%
div-sub84.7%
*-inverses84.7%
Simplified84.7%
if -2.2000000000000001e-6 < z < 4.20000000000000032e122Initial program 89.2%
*-commutative89.2%
associate-*l/96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in y around inf 72.4%
associate-/l*79.1%
Simplified79.1%
associate-/r/80.1%
Applied egg-rr80.1%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.9e-36) (not (<= z 1.3e-62))) (* x (- 1.0 (/ y z))) (/ x (/ t y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.9e-36) || !(z <= 1.3e-62)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / (t / 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 ((z <= (-3.9d-36)) .or. (.not. (z <= 1.3d-62))) then
tmp = x * (1.0d0 - (y / z))
else
tmp = x / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.9e-36) || !(z <= 1.3e-62)) {
tmp = x * (1.0 - (y / z));
} else {
tmp = x / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.9e-36) or not (z <= 1.3e-62): tmp = x * (1.0 - (y / z)) else: tmp = x / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.9e-36) || !(z <= 1.3e-62)) tmp = Float64(x * Float64(1.0 - Float64(y / z))); else tmp = Float64(x / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.9e-36) || ~((z <= 1.3e-62))) tmp = x * (1.0 - (y / z)); else tmp = x / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.9e-36], N[Not[LessEqual[z, 1.3e-62]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{-36} \lor \neg \left(z \leq 1.3 \cdot 10^{-62}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -3.9000000000000001e-36 or 1.3e-62 < z Initial program 76.6%
*-commutative76.6%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 70.5%
mul-1-neg70.5%
div-sub70.5%
sub-neg70.5%
*-inverses70.5%
metadata-eval70.5%
Simplified70.5%
Taylor expanded in x around 0 70.5%
if -3.9000000000000001e-36 < z < 1.3e-62Initial program 91.8%
*-commutative91.8%
associate-*l/95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in z around 0 72.4%
associate-/l*77.6%
Simplified77.6%
Final simplification73.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.8e-28) (not (<= z 1.02e+70))) (* x (- 1.0 (/ y z))) (* x (/ y (- t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.8e-28) || !(z <= 1.02e+70)) {
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.8d-28)) .or. (.not. (z <= 1.02d+70))) 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.8e-28) || !(z <= 1.02e+70)) {
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.8e-28) or not (z <= 1.02e+70): 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.8e-28) || !(z <= 1.02e+70)) 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.8e-28) || ~((z <= 1.02e+70))) 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.8e-28], N[Not[LessEqual[z, 1.02e+70]], $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.8 \cdot 10^{-28} \lor \neg \left(z \leq 1.02 \cdot 10^{+70}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\end{array}
\end{array}
if z < -1.7999999999999999e-28 or 1.02e70 < z Initial program 75.0%
*-commutative75.0%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 74.1%
mul-1-neg74.1%
div-sub74.1%
sub-neg74.1%
*-inverses74.1%
metadata-eval74.1%
Simplified74.1%
Taylor expanded in x around 0 74.1%
if -1.7999999999999999e-28 < z < 1.02e70Initial program 89.5%
*-commutative89.5%
associate-*l/96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in y around inf 80.4%
Final simplification77.3%
(FPCore (x y z t) :precision binary64 (if (<= z -3e-26) x (if (<= z 8.2e+112) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3e-26) {
tmp = x;
} else if (z <= 8.2e+112) {
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 <= (-3d-26)) then
tmp = x
else if (z <= 8.2d+112) 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 <= -3e-26) {
tmp = x;
} else if (z <= 8.2e+112) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3e-26: tmp = x elif z <= 8.2e+112: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3e-26) tmp = x; elseif (z <= 8.2e+112) 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 <= -3e-26) tmp = x; elseif (z <= 8.2e+112) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3e-26], x, If[LessEqual[z, 8.2e+112], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-26}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+112}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.00000000000000012e-26 or 8.19999999999999951e112 < z Initial program 74.7%
*-commutative74.7%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 62.5%
if -3.00000000000000012e-26 < z < 8.19999999999999951e112Initial program 88.8%
*-commutative88.8%
associate-*l/96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in z around 0 64.8%
Final simplification63.7%
(FPCore (x y z t) :precision binary64 (if (<= z -3.8e-15) x (if (<= z 8.2e+112) (/ x (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.8e-15) {
tmp = x;
} else if (z <= 8.2e+112) {
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.8d-15)) then
tmp = x
else if (z <= 8.2d+112) 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.8e-15) {
tmp = x;
} else if (z <= 8.2e+112) {
tmp = x / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.8e-15: tmp = x elif z <= 8.2e+112: tmp = x / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.8e-15) tmp = x; elseif (z <= 8.2e+112) 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.8e-15) tmp = x; elseif (z <= 8.2e+112) tmp = x / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.8e-15], x, If[LessEqual[z, 8.2e+112], N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-15}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+112}:\\
\;\;\;\;\frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.8000000000000002e-15 or 8.19999999999999951e112 < z Initial program 74.1%
*-commutative74.1%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 63.2%
if -3.8000000000000002e-15 < z < 8.19999999999999951e112Initial program 89.0%
*-commutative89.0%
associate-*l/96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in z around 0 57.9%
associate-/l*64.1%
Simplified64.1%
Final simplification63.7%
(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 82.2%
*-commutative82.2%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in z around inf 33.9%
Final simplification33.9%
(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 2024036
(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)))