
(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 10 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 85.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6498.0
Applied rewrites98.0%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- y z)))
(t_2 (/ t_1 t))
(t_3 (/ t_1 (- t z)))
(t_4 (- x (* (/ y z) x))))
(if (<= t_3 -2.0)
(* (/ x (- t z)) y)
(if (<= t_3 5e-301)
t_2
(if (<= t_3 5000000000.0)
(* (/ z (- z t)) x)
(if (<= t_3 2e+110) t_4 (if (<= t_3 5e+255) t_2 t_4)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y - z);
double t_2 = t_1 / t;
double t_3 = t_1 / (t - z);
double t_4 = x - ((y / z) * x);
double tmp;
if (t_3 <= -2.0) {
tmp = (x / (t - z)) * y;
} else if (t_3 <= 5e-301) {
tmp = t_2;
} else if (t_3 <= 5000000000.0) {
tmp = (z / (z - t)) * x;
} else if (t_3 <= 2e+110) {
tmp = t_4;
} else if (t_3 <= 5e+255) {
tmp = t_2;
} else {
tmp = t_4;
}
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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = x * (y - z)
t_2 = t_1 / t
t_3 = t_1 / (t - z)
t_4 = x - ((y / z) * x)
if (t_3 <= (-2.0d0)) then
tmp = (x / (t - z)) * y
else if (t_3 <= 5d-301) then
tmp = t_2
else if (t_3 <= 5000000000.0d0) then
tmp = (z / (z - t)) * x
else if (t_3 <= 2d+110) then
tmp = t_4
else if (t_3 <= 5d+255) then
tmp = t_2
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (y - z);
double t_2 = t_1 / t;
double t_3 = t_1 / (t - z);
double t_4 = x - ((y / z) * x);
double tmp;
if (t_3 <= -2.0) {
tmp = (x / (t - z)) * y;
} else if (t_3 <= 5e-301) {
tmp = t_2;
} else if (t_3 <= 5000000000.0) {
tmp = (z / (z - t)) * x;
} else if (t_3 <= 2e+110) {
tmp = t_4;
} else if (t_3 <= 5e+255) {
tmp = t_2;
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y - z) t_2 = t_1 / t t_3 = t_1 / (t - z) t_4 = x - ((y / z) * x) tmp = 0 if t_3 <= -2.0: tmp = (x / (t - z)) * y elif t_3 <= 5e-301: tmp = t_2 elif t_3 <= 5000000000.0: tmp = (z / (z - t)) * x elif t_3 <= 2e+110: tmp = t_4 elif t_3 <= 5e+255: tmp = t_2 else: tmp = t_4 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y - z)) t_2 = Float64(t_1 / t) t_3 = Float64(t_1 / Float64(t - z)) t_4 = Float64(x - Float64(Float64(y / z) * x)) tmp = 0.0 if (t_3 <= -2.0) tmp = Float64(Float64(x / Float64(t - z)) * y); elseif (t_3 <= 5e-301) tmp = t_2; elseif (t_3 <= 5000000000.0) tmp = Float64(Float64(z / Float64(z - t)) * x); elseif (t_3 <= 2e+110) tmp = t_4; elseif (t_3 <= 5e+255) tmp = t_2; else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y - z); t_2 = t_1 / t; t_3 = t_1 / (t - z); t_4 = x - ((y / z) * x); tmp = 0.0; if (t_3 <= -2.0) tmp = (x / (t - z)) * y; elseif (t_3 <= 5e-301) tmp = t_2; elseif (t_3 <= 5000000000.0) tmp = (z / (z - t)) * x; elseif (t_3 <= 2e+110) tmp = t_4; elseif (t_3 <= 5e+255) tmp = t_2; else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / t), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(t - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x - N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2.0], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$3, 5e-301], t$95$2, If[LessEqual[t$95$3, 5000000000.0], N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$3, 2e+110], t$95$4, If[LessEqual[t$95$3, 5e+255], t$95$2, t$95$4]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y - z\right)\\
t_2 := \frac{t\_1}{t}\\
t_3 := \frac{t\_1}{t - z}\\
t_4 := x - \frac{y}{z} \cdot x\\
\mathbf{if}\;t\_3 \leq -2:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-301}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 5000000000:\\
\;\;\;\;\frac{z}{z - t} \cdot x\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+110}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+255}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -2Initial program 69.9%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6457.9
Applied rewrites57.9%
if -2 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 5.00000000000000013e-301 or 2e110 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 5.0000000000000002e255Initial program 99.3%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6465.0
Applied rewrites65.0%
if 5.00000000000000013e-301 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 5e9Initial program 99.5%
Taylor expanded in y around 0
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6459.3
Applied rewrites59.3%
Applied rewrites59.3%
if 5e9 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 2e110 or 5.0000000000000002e255 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 71.0%
Taylor expanded in t around 0
mul-1-negN/A
neg-sub0N/A
associate-/l*N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
distribute-lft-outN/A
associate-/l*N/A
*-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6462.7
Applied rewrites62.7%
Applied rewrites68.3%
Final simplification62.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- y z)))
(t_2 (/ t_1 (- t z)))
(t_3 (* (/ x (- t z)) (- y z))))
(if (<= t_2 -1e-143)
t_3
(if (<= t_2 5e-301)
(/ t_1 t)
(if (<= t_2 5e-157) (* (/ z (- z t)) x) t_3)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y - z);
double t_2 = t_1 / (t - z);
double t_3 = (x / (t - z)) * (y - z);
double tmp;
if (t_2 <= -1e-143) {
tmp = t_3;
} else if (t_2 <= 5e-301) {
tmp = t_1 / t;
} else if (t_2 <= 5e-157) {
tmp = (z / (z - t)) * x;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = x * (y - z)
t_2 = t_1 / (t - z)
t_3 = (x / (t - z)) * (y - z)
if (t_2 <= (-1d-143)) then
tmp = t_3
else if (t_2 <= 5d-301) then
tmp = t_1 / t
else if (t_2 <= 5d-157) then
tmp = (z / (z - t)) * x
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (y - z);
double t_2 = t_1 / (t - z);
double t_3 = (x / (t - z)) * (y - z);
double tmp;
if (t_2 <= -1e-143) {
tmp = t_3;
} else if (t_2 <= 5e-301) {
tmp = t_1 / t;
} else if (t_2 <= 5e-157) {
tmp = (z / (z - t)) * x;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y - z) t_2 = t_1 / (t - z) t_3 = (x / (t - z)) * (y - z) tmp = 0 if t_2 <= -1e-143: tmp = t_3 elif t_2 <= 5e-301: tmp = t_1 / t elif t_2 <= 5e-157: tmp = (z / (z - t)) * x else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y - z)) t_2 = Float64(t_1 / Float64(t - z)) t_3 = Float64(Float64(x / Float64(t - z)) * Float64(y - z)) tmp = 0.0 if (t_2 <= -1e-143) tmp = t_3; elseif (t_2 <= 5e-301) tmp = Float64(t_1 / t); elseif (t_2 <= 5e-157) tmp = Float64(Float64(z / Float64(z - t)) * x); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y - z); t_2 = t_1 / (t - z); t_3 = (x / (t - z)) * (y - z); tmp = 0.0; if (t_2 <= -1e-143) tmp = t_3; elseif (t_2 <= 5e-301) tmp = t_1 / t; elseif (t_2 <= 5e-157) tmp = (z / (z - t)) * x; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(t - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-143], t$95$3, If[LessEqual[t$95$2, 5e-301], N[(t$95$1 / t), $MachinePrecision], If[LessEqual[t$95$2, 5e-157], N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y - z\right)\\
t_2 := \frac{t\_1}{t - z}\\
t_3 := \frac{x}{t - z} \cdot \left(y - z\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-143}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-301}:\\
\;\;\;\;\frac{t\_1}{t}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-157}:\\
\;\;\;\;\frac{z}{z - t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -9.9999999999999995e-144 or 5.0000000000000002e-157 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 79.9%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6491.1
Applied rewrites91.1%
if -9.9999999999999995e-144 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 5.00000000000000013e-301Initial program 99.1%
Taylor expanded in t around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.1
Applied rewrites67.1%
if 5.00000000000000013e-301 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 5.0000000000000002e-157Initial program 99.4%
Taylor expanded in y around 0
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6461.2
Applied rewrites61.2%
Applied rewrites61.2%
Final simplification83.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ z (- z t)) x))) (if (<= z -4.1e-44) t_1 (if (<= z 1e+23) (* (/ x (- t z)) y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -4.1e-44) {
tmp = t_1;
} else if (z <= 1e+23) {
tmp = (x / (t - z)) * y;
} 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 = (z / (z - t)) * x
if (z <= (-4.1d-44)) then
tmp = t_1
else if (z <= 1d+23) then
tmp = (x / (t - z)) * y
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 = (z / (z - t)) * x;
double tmp;
if (z <= -4.1e-44) {
tmp = t_1;
} else if (z <= 1e+23) {
tmp = (x / (t - z)) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / (z - t)) * x tmp = 0 if z <= -4.1e-44: tmp = t_1 elif z <= 1e+23: tmp = (x / (t - z)) * y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / Float64(z - t)) * x) tmp = 0.0 if (z <= -4.1e-44) tmp = t_1; elseif (z <= 1e+23) tmp = Float64(Float64(x / Float64(t - z)) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / (z - t)) * x; tmp = 0.0; if (z <= -4.1e-44) tmp = t_1; elseif (z <= 1e+23) tmp = (x / (t - z)) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -4.1e-44], t$95$1, If[LessEqual[z, 1e+23], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{z - t} \cdot x\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{+23}:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.09999999999999992e-44 or 9.9999999999999992e22 < z Initial program 74.5%
Taylor expanded in y around 0
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6475.0
Applied rewrites75.0%
Applied rewrites75.0%
if -4.09999999999999992e-44 < z < 9.9999999999999992e22Initial program 97.2%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6476.3
Applied rewrites76.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ x (- t z)) y))) (if (<= y -2.25e-104) t_1 (if (<= y 1.4e-11) (* (/ x (- z t)) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / (t - z)) * y;
double tmp;
if (y <= -2.25e-104) {
tmp = t_1;
} else if (y <= 1.4e-11) {
tmp = (x / (z - t)) * z;
} 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 / (t - z)) * y
if (y <= (-2.25d-104)) then
tmp = t_1
else if (y <= 1.4d-11) then
tmp = (x / (z - t)) * z
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 / (t - z)) * y;
double tmp;
if (y <= -2.25e-104) {
tmp = t_1;
} else if (y <= 1.4e-11) {
tmp = (x / (z - t)) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / (t - z)) * y tmp = 0 if y <= -2.25e-104: tmp = t_1 elif y <= 1.4e-11: tmp = (x / (z - t)) * z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / Float64(t - z)) * y) tmp = 0.0 if (y <= -2.25e-104) tmp = t_1; elseif (y <= 1.4e-11) tmp = Float64(Float64(x / Float64(z - t)) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / (t - z)) * y; tmp = 0.0; if (y <= -2.25e-104) tmp = t_1; elseif (y <= 1.4e-11) tmp = (x / (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[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.25e-104], t$95$1, If[LessEqual[y, 1.4e-11], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t - z} \cdot y\\
\mathbf{if}\;y \leq -2.25 \cdot 10^{-104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-11}:\\
\;\;\;\;\frac{x}{z - t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2499999999999999e-104 or 1.4e-11 < y Initial program 86.3%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6467.2
Applied rewrites67.2%
if -2.2499999999999999e-104 < y < 1.4e-11Initial program 83.9%
Taylor expanded in y around 0
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f6484.4
Applied rewrites84.4%
Applied rewrites72.7%
(FPCore (x y z t) :precision binary64 (if (<= z -3.9e+77) (* 1.0 x) (if (<= z 3.2e+48) (* (/ x (- t z)) y) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.9e+77) {
tmp = 1.0 * x;
} else if (z <= 3.2e+48) {
tmp = (x / (t - z)) * y;
} 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 <= (-3.9d+77)) then
tmp = 1.0d0 * x
else if (z <= 3.2d+48) then
tmp = (x / (t - z)) * y
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 <= -3.9e+77) {
tmp = 1.0 * x;
} else if (z <= 3.2e+48) {
tmp = (x / (t - z)) * y;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.9e+77: tmp = 1.0 * x elif z <= 3.2e+48: tmp = (x / (t - z)) * y else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.9e+77) tmp = Float64(1.0 * x); elseif (z <= 3.2e+48) tmp = Float64(Float64(x / Float64(t - z)) * y); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.9e+77) tmp = 1.0 * x; elseif (z <= 3.2e+48) tmp = (x / (t - z)) * y; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.9e+77], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 3.2e+48], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+77}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+48}:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -3.8999999999999998e77 or 3.2000000000000001e48 < z Initial program 69.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
Applied rewrites63.2%
if -3.8999999999999998e77 < z < 3.2000000000000001e48Initial program 96.5%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6470.3
Applied rewrites70.3%
(FPCore (x y z t) :precision binary64 (if (<= z -5.9e+69) (* 1.0 x) (if (<= z 3.2e+48) (* (/ y t) x) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.9e+69) {
tmp = 1.0 * x;
} else if (z <= 3.2e+48) {
tmp = (y / t) * x;
} 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 <= (-5.9d+69)) then
tmp = 1.0d0 * x
else if (z <= 3.2d+48) then
tmp = (y / t) * x
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 <= -5.9e+69) {
tmp = 1.0 * x;
} else if (z <= 3.2e+48) {
tmp = (y / t) * x;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.9e+69: tmp = 1.0 * x elif z <= 3.2e+48: tmp = (y / t) * x else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.9e+69) tmp = Float64(1.0 * x); elseif (z <= 3.2e+48) tmp = Float64(Float64(y / t) * x); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.9e+69) tmp = 1.0 * x; elseif (z <= 3.2e+48) tmp = (y / t) * x; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.9e+69], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 3.2e+48], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{+69}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+48}:\\
\;\;\;\;\frac{y}{t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -5.90000000000000004e69 or 3.2000000000000001e48 < z Initial program 69.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
Applied rewrites63.2%
if -5.90000000000000004e69 < z < 3.2000000000000001e48Initial program 96.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6496.7
Applied rewrites96.7%
Taylor expanded in z around 0
lower-/.f6460.6
Applied rewrites60.6%
(FPCore (x y z t) :precision binary64 (if (<= z -5.9e+69) (* 1.0 x) (if (<= z 2.4e+48) (/ (* x y) t) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.9e+69) {
tmp = 1.0 * x;
} else if (z <= 2.4e+48) {
tmp = (x * y) / 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 <= (-5.9d+69)) then
tmp = 1.0d0 * x
else if (z <= 2.4d+48) then
tmp = (x * y) / 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 <= -5.9e+69) {
tmp = 1.0 * x;
} else if (z <= 2.4e+48) {
tmp = (x * y) / t;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.9e+69: tmp = 1.0 * x elif z <= 2.4e+48: tmp = (x * y) / t else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.9e+69) tmp = Float64(1.0 * x); elseif (z <= 2.4e+48) tmp = Float64(Float64(x * y) / t); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.9e+69) tmp = 1.0 * x; elseif (z <= 2.4e+48) tmp = (x * y) / t; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.9e+69], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 2.4e+48], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{+69}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+48}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -5.90000000000000004e69 or 2.4000000000000001e48 < z Initial program 69.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
Applied rewrites63.2%
if -5.90000000000000004e69 < z < 2.4000000000000001e48Initial program 96.5%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6459.4
Applied rewrites59.4%
Final simplification61.0%
(FPCore (x y z t) :precision binary64 (if (<= z -5.9e+69) (* 1.0 x) (if (<= z 2.4e+48) (* (/ x t) y) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.9e+69) {
tmp = 1.0 * x;
} else if (z <= 2.4e+48) {
tmp = (x / t) * y;
} 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 <= (-5.9d+69)) then
tmp = 1.0d0 * x
else if (z <= 2.4d+48) then
tmp = (x / t) * y
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 <= -5.9e+69) {
tmp = 1.0 * x;
} else if (z <= 2.4e+48) {
tmp = (x / t) * y;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.9e+69: tmp = 1.0 * x elif z <= 2.4e+48: tmp = (x / t) * y else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.9e+69) tmp = Float64(1.0 * x); elseif (z <= 2.4e+48) tmp = Float64(Float64(x / t) * y); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.9e+69) tmp = 1.0 * x; elseif (z <= 2.4e+48) tmp = (x / t) * y; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.9e+69], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 2.4e+48], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{+69}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+48}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -5.90000000000000004e69 or 2.4000000000000001e48 < z Initial program 69.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in z around inf
Applied rewrites63.2%
if -5.90000000000000004e69 < z < 2.4000000000000001e48Initial program 96.5%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6459.4
Applied rewrites59.4%
Applied rewrites54.6%
(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 85.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6498.0
Applied rewrites98.0%
Taylor expanded in z around inf
Applied rewrites32.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 2024249
(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)))