
(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 11 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
(let* ((t_1 (/ (* x (- y z)) (- t z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+297)))
(* (+ t z) (* (/ x (+ t z)) (/ (- y z) (- t z))))
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+297)) {
tmp = (t + z) * ((x / (t + z)) * ((y - z) / (t - z)));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+297)) {
tmp = (t + z) * ((x / (t + z)) * ((y - z) / (t - z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * (y - z)) / (t - z) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+297): tmp = (t + z) * ((x / (t + z)) * ((y - z) / (t - z))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y - z)) / Float64(t - z)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+297)) tmp = Float64(Float64(t + z) * Float64(Float64(x / Float64(t + z)) * Float64(Float64(y - z) / Float64(t - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * (y - z)) / (t - z); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+297))) tmp = (t + z) * ((x / (t + z)) * ((y - z) / (t - z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+297]], $MachinePrecision]], N[(N[(t + z), $MachinePrecision] * N[(N[(x / N[(t + z), $MachinePrecision]), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+297}\right):\\
\;\;\;\;\left(t + z\right) \cdot \left(\frac{x}{t + z} \cdot \frac{y - z}{t - z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -inf.0 or 2e297 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 35.5%
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 2e297Initial program 98.4%
Final simplification98.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (- y z)) (- t z))) (t_2 (* (/ x (- t z)) y)))
(if (<= t_1 -5e+15)
t_2
(if (<= t_1 5e-288)
(/ (* (- y z) x) t)
(if (<= t_1 50000000000.0)
(- x (/ (* y x) z))
(if (<= t_1 2e+58) t_2 (* (- z y) (/ x z))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double t_2 = (x / (t - z)) * y;
double tmp;
if (t_1 <= -5e+15) {
tmp = t_2;
} else if (t_1 <= 5e-288) {
tmp = ((y - z) * x) / t;
} else if (t_1 <= 50000000000.0) {
tmp = x - ((y * x) / z);
} else if (t_1 <= 2e+58) {
tmp = t_2;
} else {
tmp = (z - y) * (x / 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * (y - z)) / (t - z)
t_2 = (x / (t - z)) * y
if (t_1 <= (-5d+15)) then
tmp = t_2
else if (t_1 <= 5d-288) then
tmp = ((y - z) * x) / t
else if (t_1 <= 50000000000.0d0) then
tmp = x - ((y * x) / z)
else if (t_1 <= 2d+58) then
tmp = t_2
else
tmp = (z - y) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double t_2 = (x / (t - z)) * y;
double tmp;
if (t_1 <= -5e+15) {
tmp = t_2;
} else if (t_1 <= 5e-288) {
tmp = ((y - z) * x) / t;
} else if (t_1 <= 50000000000.0) {
tmp = x - ((y * x) / z);
} else if (t_1 <= 2e+58) {
tmp = t_2;
} else {
tmp = (z - y) * (x / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * (y - z)) / (t - z) t_2 = (x / (t - z)) * y tmp = 0 if t_1 <= -5e+15: tmp = t_2 elif t_1 <= 5e-288: tmp = ((y - z) * x) / t elif t_1 <= 50000000000.0: tmp = x - ((y * x) / z) elif t_1 <= 2e+58: tmp = t_2 else: tmp = (z - y) * (x / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y - z)) / Float64(t - z)) t_2 = Float64(Float64(x / Float64(t - z)) * y) tmp = 0.0 if (t_1 <= -5e+15) tmp = t_2; elseif (t_1 <= 5e-288) tmp = Float64(Float64(Float64(y - z) * x) / t); elseif (t_1 <= 50000000000.0) tmp = Float64(x - Float64(Float64(y * x) / z)); elseif (t_1 <= 2e+58) tmp = t_2; else tmp = Float64(Float64(z - y) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * (y - z)) / (t - z); t_2 = (x / (t - z)) * y; tmp = 0.0; if (t_1 <= -5e+15) tmp = t_2; elseif (t_1 <= 5e-288) tmp = ((y - z) * x) / t; elseif (t_1 <= 50000000000.0) tmp = x - ((y * x) / z); elseif (t_1 <= 2e+58) tmp = t_2; else tmp = (z - y) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+15], t$95$2, If[LessEqual[t$95$1, 5e-288], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 50000000000.0], N[(x - N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+58], t$95$2, N[(N[(z - y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
t_2 := \frac{x}{t - z} \cdot y\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+15}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-288}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\
\mathbf{elif}\;t\_1 \leq 50000000000:\\
\;\;\;\;x - \frac{y \cdot x}{z}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+58}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(z - y\right) \cdot \frac{x}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -5e15 or 5e10 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.99999999999999989e58Initial program 78.5%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6460.1
Applied rewrites60.1%
if -5e15 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 5.00000000000000011e-288Initial program 96.6%
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6467.6
Applied rewrites67.6%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6465.8
Applied rewrites65.8%
if 5.00000000000000011e-288 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 5e10Initial program 99.7%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6456.6
Applied rewrites56.6%
Taylor expanded in y around 0
Applied rewrites56.6%
if 1.99999999999999989e58 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 67.4%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6457.4
Applied rewrites57.4%
Applied rewrites59.6%
Final simplification61.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (- y z)) (- t z))))
(if (<= t_1 -5e+118)
(* (/ x (- t z)) y)
(if (<= t_1 2e+297) t_1 (* (/ (- z y) z) x)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if (t_1 <= -5e+118) {
tmp = (x / (t - z)) * y;
} else if (t_1 <= 2e+297) {
tmp = t_1;
} else {
tmp = ((z - y) / z) * 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 - z)) / (t - z)
if (t_1 <= (-5d+118)) then
tmp = (x / (t - z)) * y
else if (t_1 <= 2d+297) then
tmp = t_1
else
tmp = ((z - y) / z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if (t_1 <= -5e+118) {
tmp = (x / (t - z)) * y;
} else if (t_1 <= 2e+297) {
tmp = t_1;
} else {
tmp = ((z - y) / z) * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * (y - z)) / (t - z) tmp = 0 if t_1 <= -5e+118: tmp = (x / (t - z)) * y elif t_1 <= 2e+297: tmp = t_1 else: tmp = ((z - y) / z) * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y - z)) / Float64(t - z)) tmp = 0.0 if (t_1 <= -5e+118) tmp = Float64(Float64(x / Float64(t - z)) * y); elseif (t_1 <= 2e+297) tmp = t_1; else tmp = Float64(Float64(Float64(z - y) / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * (y - z)) / (t - z); tmp = 0.0; if (t_1 <= -5e+118) tmp = (x / (t - z)) * y; elseif (t_1 <= 2e+297) tmp = t_1; else tmp = ((z - y) / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+118], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 2e+297], t$95$1, N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+118}:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+297}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z - y}{z} \cdot x\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -4.99999999999999972e118Initial program 63.9%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6460.5
Applied rewrites60.5%
if -4.99999999999999972e118 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 2e297Initial program 98.3%
if 2e297 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 27.6%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6476.6
Applied rewrites76.6%
Final simplification90.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.05e+77)
(* 1.0 x)
(if (<= z -5.8e-38)
(* (- x) (/ z t))
(if (<= z 9e-25) (/ (* y x) t) (* 1.0 x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.05e+77) {
tmp = 1.0 * x;
} else if (z <= -5.8e-38) {
tmp = -x * (z / t);
} else if (z <= 9e-25) {
tmp = (y * x) / t;
} else {
tmp = 1.0 * 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.05d+77)) then
tmp = 1.0d0 * x
else if (z <= (-5.8d-38)) then
tmp = -x * (z / t)
else if (z <= 9d-25) then
tmp = (y * x) / t
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.05e+77) {
tmp = 1.0 * x;
} else if (z <= -5.8e-38) {
tmp = -x * (z / t);
} else if (z <= 9e-25) {
tmp = (y * x) / t;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.05e+77: tmp = 1.0 * x elif z <= -5.8e-38: tmp = -x * (z / t) elif z <= 9e-25: tmp = (y * x) / t else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.05e+77) tmp = Float64(1.0 * x); elseif (z <= -5.8e-38) tmp = Float64(Float64(-x) * Float64(z / t)); elseif (z <= 9e-25) tmp = Float64(Float64(y * x) / t); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.05e+77) tmp = 1.0 * x; elseif (z <= -5.8e-38) tmp = -x * (z / t); elseif (z <= 9e-25) tmp = (y * x) / t; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.05e+77], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, -5.8e-38], N[((-x) * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-25], N[(N[(y * x), $MachinePrecision] / t), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+77}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-38}:\\
\;\;\;\;\left(-x\right) \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-25}:\\
\;\;\;\;\frac{y \cdot x}{t}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -1.0499999999999999e77 or 9.0000000000000002e-25 < z Initial program 77.8%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6480.3
Applied rewrites80.3%
Taylor expanded in y around 0
Applied rewrites63.7%
if -1.0499999999999999e77 < z < -5.79999999999999988e-38Initial program 95.3%
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6492.2
Applied rewrites92.2%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6454.4
Applied rewrites54.4%
Taylor expanded in y around 0
Applied rewrites55.1%
if -5.79999999999999988e-38 < z < 9.0000000000000002e-25Initial program 93.0%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6470.9
Applied rewrites70.9%
Final simplification66.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -44000000000.0) (not (<= t 1.05e+38))) (* (/ (- y z) t) x) (* (/ (- z y) z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -44000000000.0) || !(t <= 1.05e+38)) {
tmp = ((y - z) / t) * x;
} else {
tmp = ((z - y) / z) * 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 ((t <= (-44000000000.0d0)) .or. (.not. (t <= 1.05d+38))) then
tmp = ((y - z) / t) * x
else
tmp = ((z - y) / z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -44000000000.0) || !(t <= 1.05e+38)) {
tmp = ((y - z) / t) * x;
} else {
tmp = ((z - y) / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -44000000000.0) or not (t <= 1.05e+38): tmp = ((y - z) / t) * x else: tmp = ((z - y) / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -44000000000.0) || !(t <= 1.05e+38)) tmp = Float64(Float64(Float64(y - z) / t) * x); else tmp = Float64(Float64(Float64(z - y) / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -44000000000.0) || ~((t <= 1.05e+38))) tmp = ((y - z) / t) * x; else tmp = ((z - y) / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -44000000000.0], N[Not[LessEqual[t, 1.05e+38]], $MachinePrecision]], N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -44000000000 \lor \neg \left(t \leq 1.05 \cdot 10^{+38}\right):\\
\;\;\;\;\frac{y - z}{t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{z - y}{z} \cdot x\\
\end{array}
\end{array}
if t < -4.4e10 or 1.05e38 < t Initial program 88.2%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6482.0
Applied rewrites82.0%
if -4.4e10 < t < 1.05e38Initial program 85.7%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6479.5
Applied rewrites79.5%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -44000000000.0) (not (<= t 2.4e+29))) (* (/ (- y z) t) x) (- x (/ (* y x) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -44000000000.0) || !(t <= 2.4e+29)) {
tmp = ((y - z) / t) * x;
} else {
tmp = x - ((y * x) / 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 ((t <= (-44000000000.0d0)) .or. (.not. (t <= 2.4d+29))) then
tmp = ((y - z) / t) * x
else
tmp = x - ((y * x) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -44000000000.0) || !(t <= 2.4e+29)) {
tmp = ((y - z) / t) * x;
} else {
tmp = x - ((y * x) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -44000000000.0) or not (t <= 2.4e+29): tmp = ((y - z) / t) * x else: tmp = x - ((y * x) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -44000000000.0) || !(t <= 2.4e+29)) tmp = Float64(Float64(Float64(y - z) / t) * x); else tmp = Float64(x - Float64(Float64(y * x) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -44000000000.0) || ~((t <= 2.4e+29))) tmp = ((y - z) / t) * x; else tmp = x - ((y * x) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -44000000000.0], N[Not[LessEqual[t, 2.4e+29]], $MachinePrecision]], N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x), $MachinePrecision], N[(x - N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -44000000000 \lor \neg \left(t \leq 2.4 \cdot 10^{+29}\right):\\
\;\;\;\;\frac{y - z}{t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot x}{z}\\
\end{array}
\end{array}
if t < -4.4e10 or 2.4000000000000001e29 < t Initial program 88.2%
Taylor expanded in t around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6482.0
Applied rewrites82.0%
if -4.4e10 < t < 2.4000000000000001e29Initial program 85.7%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in y around 0
Applied rewrites74.2%
Final simplification77.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -44000000000.0) (not (<= t 9e+37))) (/ (* (- y z) x) t) (- x (/ (* y x) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -44000000000.0) || !(t <= 9e+37)) {
tmp = ((y - z) * x) / t;
} else {
tmp = x - ((y * x) / 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 ((t <= (-44000000000.0d0)) .or. (.not. (t <= 9d+37))) then
tmp = ((y - z) * x) / t
else
tmp = x - ((y * x) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -44000000000.0) || !(t <= 9e+37)) {
tmp = ((y - z) * x) / t;
} else {
tmp = x - ((y * x) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -44000000000.0) or not (t <= 9e+37): tmp = ((y - z) * x) / t else: tmp = x - ((y * x) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -44000000000.0) || !(t <= 9e+37)) tmp = Float64(Float64(Float64(y - z) * x) / t); else tmp = Float64(x - Float64(Float64(y * x) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -44000000000.0) || ~((t <= 9e+37))) tmp = ((y - z) * x) / t; else tmp = x - ((y * x) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -44000000000.0], N[Not[LessEqual[t, 9e+37]], $MachinePrecision]], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / t), $MachinePrecision], N[(x - N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -44000000000 \lor \neg \left(t \leq 9 \cdot 10^{+37}\right):\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot x}{z}\\
\end{array}
\end{array}
if t < -4.4e10 or 8.99999999999999923e37 < t Initial program 88.2%
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6469.0
Applied rewrites69.0%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.8
Applied rewrites79.8%
if -4.4e10 < t < 8.99999999999999923e37Initial program 85.7%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6479.5
Applied rewrites79.5%
Taylor expanded in y around 0
Applied rewrites74.2%
Final simplification76.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.25e+77) (not (<= z 3.15e+40))) (* 1.0 x) (/ (* (- y z) x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.25e+77) || !(z <= 3.15e+40)) {
tmp = 1.0 * x;
} else {
tmp = ((y - z) * x) / 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 ((z <= (-2.25d+77)) .or. (.not. (z <= 3.15d+40))) then
tmp = 1.0d0 * x
else
tmp = ((y - z) * x) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.25e+77) || !(z <= 3.15e+40)) {
tmp = 1.0 * x;
} else {
tmp = ((y - z) * x) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.25e+77) or not (z <= 3.15e+40): tmp = 1.0 * x else: tmp = ((y - z) * x) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.25e+77) || !(z <= 3.15e+40)) tmp = Float64(1.0 * x); else tmp = Float64(Float64(Float64(y - z) * x) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.25e+77) || ~((z <= 3.15e+40))) tmp = 1.0 * x; else tmp = ((y - z) * x) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.25e+77], N[Not[LessEqual[z, 3.15e+40]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] * x), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+77} \lor \neg \left(z \leq 3.15 \cdot 10^{+40}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\
\end{array}
\end{array}
if z < -2.25000000000000012e77 or 3.15000000000000003e40 < z Initial program 75.2%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6484.5
Applied rewrites84.5%
Taylor expanded in y around 0
Applied rewrites68.5%
if -2.25000000000000012e77 < z < 3.15000000000000003e40Initial program 93.3%
lift-/.f64N/A
lift--.f64N/A
flip--N/A
associate-/r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
lift--.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f6480.9
Applied rewrites80.9%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6470.4
Applied rewrites70.4%
Final simplification69.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.00135) (not (<= z 9e-25))) (* 1.0 x) (/ (* y x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00135) || !(z <= 9e-25)) {
tmp = 1.0 * x;
} else {
tmp = (y * x) / 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 ((z <= (-0.00135d0)) .or. (.not. (z <= 9d-25))) then
tmp = 1.0d0 * x
else
tmp = (y * x) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00135) || !(z <= 9e-25)) {
tmp = 1.0 * x;
} else {
tmp = (y * x) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.00135) or not (z <= 9e-25): tmp = 1.0 * x else: tmp = (y * x) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.00135) || !(z <= 9e-25)) tmp = Float64(1.0 * x); else tmp = Float64(Float64(y * x) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -0.00135) || ~((z <= 9e-25))) tmp = 1.0 * x; else tmp = (y * x) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.00135], N[Not[LessEqual[z, 9e-25]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00135 \lor \neg \left(z \leq 9 \cdot 10^{-25}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{t}\\
\end{array}
\end{array}
if z < -0.0013500000000000001 or 9.0000000000000002e-25 < z Initial program 79.5%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6476.7
Applied rewrites76.7%
Taylor expanded in y around 0
Applied rewrites59.7%
if -0.0013500000000000001 < z < 9.0000000000000002e-25Initial program 93.4%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6468.8
Applied rewrites68.8%
Final simplification64.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -0.00135) (not (<= z 270000.0))) (* 1.0 x) (* x (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00135) || !(z <= 270000.0)) {
tmp = 1.0 * x;
} 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) :: tmp
if ((z <= (-0.00135d0)) .or. (.not. (z <= 270000.0d0))) then
tmp = 1.0d0 * x
else
tmp = x * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.00135) || !(z <= 270000.0)) {
tmp = 1.0 * x;
} else {
tmp = x * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.00135) or not (z <= 270000.0): tmp = 1.0 * x else: tmp = x * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.00135) || !(z <= 270000.0)) tmp = Float64(1.0 * x); else tmp = Float64(x * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -0.00135) || ~((z <= 270000.0))) tmp = 1.0 * x; else tmp = x * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.00135], N[Not[LessEqual[z, 270000.0]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00135 \lor \neg \left(z \leq 270000\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -0.0013500000000000001 or 2.7e5 < z Initial program 79.0%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6477.7
Applied rewrites77.7%
Taylor expanded in y around 0
Applied rewrites61.3%
if -0.0013500000000000001 < z < 2.7e5Initial program 93.1%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6466.5
Applied rewrites66.5%
Applied rewrites66.9%
Final simplification64.4%
(FPCore (x y z t) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t) {
return 1.0 * 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t) {
return 1.0 * x;
}
def code(x, y, z, t): return 1.0 * x
function code(x, y, z, t) return Float64(1.0 * x) end
function tmp = code(x, y, z, t) tmp = 1.0 * x; end
code[x_, y_, z_, t_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 86.8%
Taylor expanded in t around 0
mul-1-negN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
mul-1-negN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
lower--.f6450.4
Applied rewrites50.4%
Taylor expanded in y around 0
Applied rewrites34.0%
Final simplification34.0%
(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 2024320
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (/ x (/ (- t z) (- y z))))
(/ (* x (- y z)) (- t z)))