
(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 84.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6496.9
Applied rewrites96.9%
Final simplification96.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ z (- z t)) x)))
(if (<= z -4.8e+105)
(* (/ (- y z) (- z)) x)
(if (<= z -1.15e+20) t_1 (if (<= z 2.3e-49) (* (/ y (- t z)) x) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -4.8e+105) {
tmp = ((y - z) / -z) * x;
} else if (z <= -1.15e+20) {
tmp = t_1;
} else if (z <= 2.3e-49) {
tmp = (y / (t - z)) * x;
} 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.8d+105)) then
tmp = ((y - z) / -z) * x
else if (z <= (-1.15d+20)) then
tmp = t_1
else if (z <= 2.3d-49) then
tmp = (y / (t - z)) * x
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.8e+105) {
tmp = ((y - z) / -z) * x;
} else if (z <= -1.15e+20) {
tmp = t_1;
} else if (z <= 2.3e-49) {
tmp = (y / (t - z)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / (z - t)) * x tmp = 0 if z <= -4.8e+105: tmp = ((y - z) / -z) * x elif z <= -1.15e+20: tmp = t_1 elif z <= 2.3e-49: tmp = (y / (t - z)) * x 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.8e+105) tmp = Float64(Float64(Float64(y - z) / Float64(-z)) * x); elseif (z <= -1.15e+20) tmp = t_1; elseif (z <= 2.3e-49) tmp = Float64(Float64(y / Float64(t - z)) * x); 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.8e+105) tmp = ((y - z) / -z) * x; elseif (z <= -1.15e+20) tmp = t_1; elseif (z <= 2.3e-49) tmp = (y / (t - z)) * x; 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.8e+105], N[(N[(N[(y - z), $MachinePrecision] / (-z)), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -1.15e+20], t$95$1, If[LessEqual[z, 2.3e-49], N[(N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{z - t} \cdot x\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+105}:\\
\;\;\;\;\frac{y - z}{-z} \cdot x\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{t - z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.7999999999999995e105Initial program 71.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6487.2
Applied rewrites87.2%
if -4.7999999999999995e105 < z < -1.15e20 or 2.2999999999999999e-49 < z Initial program 77.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6478.9
Applied rewrites78.9%
if -1.15e20 < z < 2.2999999999999999e-49Initial program 94.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6493.7
Applied rewrites93.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6481.4
Applied rewrites81.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ z (- z t)) x)))
(if (<= z -4.8e+105)
(- x (/ (* x y) z))
(if (<= z -1.15e+20) t_1 (if (<= z 2.3e-49) (* (/ y (- t z)) x) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -4.8e+105) {
tmp = x - ((x * y) / z);
} else if (z <= -1.15e+20) {
tmp = t_1;
} else if (z <= 2.3e-49) {
tmp = (y / (t - z)) * x;
} 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.8d+105)) then
tmp = x - ((x * y) / z)
else if (z <= (-1.15d+20)) then
tmp = t_1
else if (z <= 2.3d-49) then
tmp = (y / (t - z)) * x
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.8e+105) {
tmp = x - ((x * y) / z);
} else if (z <= -1.15e+20) {
tmp = t_1;
} else if (z <= 2.3e-49) {
tmp = (y / (t - z)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / (z - t)) * x tmp = 0 if z <= -4.8e+105: tmp = x - ((x * y) / z) elif z <= -1.15e+20: tmp = t_1 elif z <= 2.3e-49: tmp = (y / (t - z)) * x 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.8e+105) tmp = Float64(x - Float64(Float64(x * y) / z)); elseif (z <= -1.15e+20) tmp = t_1; elseif (z <= 2.3e-49) tmp = Float64(Float64(y / Float64(t - z)) * x); 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.8e+105) tmp = x - ((x * y) / z); elseif (z <= -1.15e+20) tmp = t_1; elseif (z <= 2.3e-49) tmp = (y / (t - z)) * x; 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.8e+105], N[(x - N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.15e+20], t$95$1, If[LessEqual[z, 2.3e-49], N[(N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{z - t} \cdot x\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+105}:\\
\;\;\;\;x - \frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{t - z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.7999999999999995e105Initial 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-*.f6484.5
Applied rewrites84.5%
if -4.7999999999999995e105 < z < -1.15e20 or 2.2999999999999999e-49 < z Initial program 77.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6478.9
Applied rewrites78.9%
if -1.15e20 < z < 2.2999999999999999e-49Initial program 94.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6493.7
Applied rewrites93.7%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6481.4
Applied rewrites81.4%
Final simplification80.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ z (- z t)) x)))
(if (<= z -4.8e+105)
(- x (/ (* x y) z))
(if (<= z -1.15e+20) t_1 (if (<= z 2.3e-49) (* (/ 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.8e+105) {
tmp = x - ((x * y) / z);
} else if (z <= -1.15e+20) {
tmp = t_1;
} else if (z <= 2.3e-49) {
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.8d+105)) then
tmp = x - ((x * y) / z)
else if (z <= (-1.15d+20)) then
tmp = t_1
else if (z <= 2.3d-49) 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.8e+105) {
tmp = x - ((x * y) / z);
} else if (z <= -1.15e+20) {
tmp = t_1;
} else if (z <= 2.3e-49) {
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.8e+105: tmp = x - ((x * y) / z) elif z <= -1.15e+20: tmp = t_1 elif z <= 2.3e-49: 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.8e+105) tmp = Float64(x - Float64(Float64(x * y) / z)); elseif (z <= -1.15e+20) tmp = t_1; elseif (z <= 2.3e-49) 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.8e+105) tmp = x - ((x * y) / z); elseif (z <= -1.15e+20) tmp = t_1; elseif (z <= 2.3e-49) 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.8e+105], N[(x - N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.15e+20], t$95$1, If[LessEqual[z, 2.3e-49], 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.8 \cdot 10^{+105}:\\
\;\;\;\;x - \frac{x \cdot y}{z}\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-49}:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.7999999999999995e105Initial 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-*.f6484.5
Applied rewrites84.5%
if -4.7999999999999995e105 < z < -1.15e20 or 2.2999999999999999e-49 < z Initial program 77.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6478.9
Applied rewrites78.9%
if -1.15e20 < z < 2.2999999999999999e-49Initial program 94.8%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6478.7
Applied rewrites78.7%
Final simplification79.6%
(FPCore (x y z t) :precision binary64 (if (<= z -1.16e+160) (* (/ (- y z) (- z)) x) (if (<= z 1.02e+154) (* (/ x (- t z)) (- y z)) (* (/ z (- z t)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.16e+160) {
tmp = ((y - z) / -z) * x;
} else if (z <= 1.02e+154) {
tmp = (x / (t - z)) * (y - z);
} else {
tmp = (z / (z - t)) * 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.16d+160)) then
tmp = ((y - z) / -z) * x
else if (z <= 1.02d+154) then
tmp = (x / (t - z)) * (y - z)
else
tmp = (z / (z - t)) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.16e+160) {
tmp = ((y - z) / -z) * x;
} else if (z <= 1.02e+154) {
tmp = (x / (t - z)) * (y - z);
} else {
tmp = (z / (z - t)) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.16e+160: tmp = ((y - z) / -z) * x elif z <= 1.02e+154: tmp = (x / (t - z)) * (y - z) else: tmp = (z / (z - t)) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.16e+160) tmp = Float64(Float64(Float64(y - z) / Float64(-z)) * x); elseif (z <= 1.02e+154) tmp = Float64(Float64(x / Float64(t - z)) * Float64(y - z)); else tmp = Float64(Float64(z / Float64(z - t)) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.16e+160) tmp = ((y - z) / -z) * x; elseif (z <= 1.02e+154) tmp = (x / (t - z)) * (y - z); else tmp = (z / (z - t)) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.16e+160], N[(N[(N[(y - z), $MachinePrecision] / (-z)), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.02e+154], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.16 \cdot 10^{+160}:\\
\;\;\;\;\frac{y - z}{-z} \cdot x\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{z - t} \cdot x\\
\end{array}
\end{array}
if z < -1.16000000000000006e160Initial program 72.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f6492.1
Applied rewrites92.1%
if -1.16000000000000006e160 < z < 1.02000000000000007e154Initial program 91.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6491.3
Applied rewrites91.3%
if 1.02000000000000007e154 < z Initial program 54.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64100.0
Applied rewrites100.0%
Taylor expanded in y around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6499.9
Applied rewrites99.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ z (- z t)) x))) (if (<= z -1.15e+20) t_1 (if (<= z 2.3e-49) (* (/ 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 <= -1.15e+20) {
tmp = t_1;
} else if (z <= 2.3e-49) {
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 <= (-1.15d+20)) then
tmp = t_1
else if (z <= 2.3d-49) 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 <= -1.15e+20) {
tmp = t_1;
} else if (z <= 2.3e-49) {
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 <= -1.15e+20: tmp = t_1 elif z <= 2.3e-49: 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 <= -1.15e+20) tmp = t_1; elseif (z <= 2.3e-49) 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 <= -1.15e+20) tmp = t_1; elseif (z <= 2.3e-49) 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, -1.15e+20], t$95$1, If[LessEqual[z, 2.3e-49], 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 -1.15 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-49}:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.15e20 or 2.2999999999999999e-49 < z Initial program 75.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6475.8
Applied rewrites75.8%
if -1.15e20 < z < 2.2999999999999999e-49Initial program 94.8%
Taylor expanded in y around inf
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6478.7
Applied rewrites78.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ z (- z t)) x))) (if (<= z -3.35e+19) t_1 (if (<= z 7e-50) (* (/ y t) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -3.35e+19) {
tmp = t_1;
} else if (z <= 7e-50) {
tmp = (y / t) * x;
} 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 <= (-3.35d+19)) then
tmp = t_1
else if (z <= 7d-50) then
tmp = (y / t) * x
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 <= -3.35e+19) {
tmp = t_1;
} else if (z <= 7e-50) {
tmp = (y / t) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / (z - t)) * x tmp = 0 if z <= -3.35e+19: tmp = t_1 elif z <= 7e-50: tmp = (y / t) * x 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 <= -3.35e+19) tmp = t_1; elseif (z <= 7e-50) tmp = Float64(Float64(y / t) * x); 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 <= -3.35e+19) tmp = t_1; elseif (z <= 7e-50) tmp = (y / t) * x; 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, -3.35e+19], t$95$1, If[LessEqual[z, 7e-50], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{z - t} \cdot x\\
\mathbf{if}\;z \leq -3.35 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-50}:\\
\;\;\;\;\frac{y}{t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.35e19 or 6.99999999999999993e-50 < z Initial program 75.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
frac-2negN/A
lower-/.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f64N/A
neg-sub0N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
lower--.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6475.8
Applied rewrites75.8%
if -3.35e19 < z < 6.99999999999999993e-50Initial program 94.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6493.7
Applied rewrites93.7%
Taylor expanded in z around 0
lower-/.f6466.0
Applied rewrites66.0%
(FPCore (x y z t) :precision binary64 (if (<= z -2.15e+20) (* 1.0 x) (if (<= z 8.5e-17) (* (/ y t) x) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.15e+20) {
tmp = 1.0 * x;
} else if (z <= 8.5e-17) {
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 <= (-2.15d+20)) then
tmp = 1.0d0 * x
else if (z <= 8.5d-17) 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 <= -2.15e+20) {
tmp = 1.0 * x;
} else if (z <= 8.5e-17) {
tmp = (y / t) * x;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.15e+20: tmp = 1.0 * x elif z <= 8.5e-17: tmp = (y / t) * x else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.15e+20) tmp = Float64(1.0 * x); elseif (z <= 8.5e-17) 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 <= -2.15e+20) tmp = 1.0 * x; elseif (z <= 8.5e-17) tmp = (y / t) * x; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.15e+20], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 8.5e-17], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+20}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-17}:\\
\;\;\;\;\frac{y}{t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -2.15e20 or 8.5e-17 < z Initial program 74.5%
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 rewrites55.0%
if -2.15e20 < z < 8.5e-17Initial program 94.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6494.0
Applied rewrites94.0%
Taylor expanded in z around 0
lower-/.f6464.9
Applied rewrites64.9%
(FPCore (x y z t) :precision binary64 (if (<= z -1.25e+20) (* 1.0 x) (if (<= z 5.4e-28) (* (/ x t) y) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.25e+20) {
tmp = 1.0 * x;
} else if (z <= 5.4e-28) {
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 <= (-1.25d+20)) then
tmp = 1.0d0 * x
else if (z <= 5.4d-28) 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 <= -1.25e+20) {
tmp = 1.0 * x;
} else if (z <= 5.4e-28) {
tmp = (x / t) * y;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.25e+20: tmp = 1.0 * x elif z <= 5.4e-28: tmp = (x / t) * y else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.25e+20) tmp = Float64(1.0 * x); elseif (z <= 5.4e-28) 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 <= -1.25e+20) tmp = 1.0 * x; elseif (z <= 5.4e-28) tmp = (x / t) * y; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.25e+20], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 5.4e-28], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+20}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-28}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -1.25e20 or 5.3999999999999998e-28 < z Initial program 75.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 rewrites54.6%
if -1.25e20 < z < 5.3999999999999998e-28Initial program 94.9%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.5
Applied rewrites64.5%
Applied rewrites64.8%
(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 84.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6496.9
Applied rewrites96.9%
Taylor expanded in z around inf
Applied rewrites32.8%
(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 2024235
(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)))