
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
Initial program 99.5%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* t (/ y (- z a))))) (t_2 (- x (/ y (/ (- a z) z)))))
(if (<= z -1.9e+44)
t_2
(if (<= z -3.4e-146)
t_1
(if (<= z 8e-179) (+ x (/ y (/ a t))) (if (<= z 3.7e+36) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / (z - a)));
double t_2 = x - (y / ((a - z) / z));
double tmp;
if (z <= -1.9e+44) {
tmp = t_2;
} else if (z <= -3.4e-146) {
tmp = t_1;
} else if (z <= 8e-179) {
tmp = x + (y / (a / t));
} else if (z <= 3.7e+36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x - (t * (y / (z - a)))
t_2 = x - (y / ((a - z) / z))
if (z <= (-1.9d+44)) then
tmp = t_2
else if (z <= (-3.4d-146)) then
tmp = t_1
else if (z <= 8d-179) then
tmp = x + (y / (a / t))
else if (z <= 3.7d+36) 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 a) {
double t_1 = x - (t * (y / (z - a)));
double t_2 = x - (y / ((a - z) / z));
double tmp;
if (z <= -1.9e+44) {
tmp = t_2;
} else if (z <= -3.4e-146) {
tmp = t_1;
} else if (z <= 8e-179) {
tmp = x + (y / (a / t));
} else if (z <= 3.7e+36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (t * (y / (z - a))) t_2 = x - (y / ((a - z) / z)) tmp = 0 if z <= -1.9e+44: tmp = t_2 elif z <= -3.4e-146: tmp = t_1 elif z <= 8e-179: tmp = x + (y / (a / t)) elif z <= 3.7e+36: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(t * Float64(y / Float64(z - a)))) t_2 = Float64(x - Float64(y / Float64(Float64(a - z) / z))) tmp = 0.0 if (z <= -1.9e+44) tmp = t_2; elseif (z <= -3.4e-146) tmp = t_1; elseif (z <= 8e-179) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 3.7e+36) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (t * (y / (z - a))); t_2 = x - (y / ((a - z) / z)); tmp = 0.0; if (z <= -1.9e+44) tmp = t_2; elseif (z <= -3.4e-146) tmp = t_1; elseif (z <= 8e-179) tmp = x + (y / (a / t)); elseif (z <= 3.7e+36) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+44], t$95$2, If[LessEqual[z, -3.4e-146], t$95$1, If[LessEqual[z, 8e-179], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+36], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - t \cdot \frac{y}{z - a}\\
t_2 := x - \frac{y}{\frac{a - z}{z}}\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+44}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-179}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.9000000000000001e44 or 3.70000000000000029e36 < z Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 92.1%
if -1.9000000000000001e44 < z < -3.4000000000000001e-146 or 8.0000000000000002e-179 < z < 3.70000000000000029e36Initial program 98.8%
Taylor expanded in t around inf 85.2%
associate-*r/85.2%
mul-1-neg85.2%
distribute-lft-neg-out85.2%
*-commutative85.2%
associate-/l*89.3%
distribute-neg-frac89.3%
distribute-neg-frac289.3%
sub-neg89.3%
mul-1-neg89.3%
distribute-neg-in89.3%
mul-1-neg89.3%
remove-double-neg89.3%
Simplified89.3%
Taylor expanded in x around 0 85.2%
+-commutative85.2%
associate-/l*88.4%
Simplified88.4%
if -3.4000000000000001e-146 < z < 8.0000000000000002e-179Initial program 99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 90.5%
Final simplification90.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* t (/ y (- z a))))))
(if (<= z -1e+42)
(- x (* y (/ z (- a z))))
(if (<= z -7.1e-140)
t_1
(if (<= z 1.25e-179)
(+ x (/ y (/ a t)))
(if (<= z 1.05e+36) t_1 (- x (/ y (/ (- a z) z)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / (z - a)));
double tmp;
if (z <= -1e+42) {
tmp = x - (y * (z / (a - z)));
} else if (z <= -7.1e-140) {
tmp = t_1;
} else if (z <= 1.25e-179) {
tmp = x + (y / (a / t));
} else if (z <= 1.05e+36) {
tmp = t_1;
} else {
tmp = x - (y / ((a - z) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x - (t * (y / (z - a)))
if (z <= (-1d+42)) then
tmp = x - (y * (z / (a - z)))
else if (z <= (-7.1d-140)) then
tmp = t_1
else if (z <= 1.25d-179) then
tmp = x + (y / (a / t))
else if (z <= 1.05d+36) then
tmp = t_1
else
tmp = x - (y / ((a - z) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / (z - a)));
double tmp;
if (z <= -1e+42) {
tmp = x - (y * (z / (a - z)));
} else if (z <= -7.1e-140) {
tmp = t_1;
} else if (z <= 1.25e-179) {
tmp = x + (y / (a / t));
} else if (z <= 1.05e+36) {
tmp = t_1;
} else {
tmp = x - (y / ((a - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (t * (y / (z - a))) tmp = 0 if z <= -1e+42: tmp = x - (y * (z / (a - z))) elif z <= -7.1e-140: tmp = t_1 elif z <= 1.25e-179: tmp = x + (y / (a / t)) elif z <= 1.05e+36: tmp = t_1 else: tmp = x - (y / ((a - z) / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(t * Float64(y / Float64(z - a)))) tmp = 0.0 if (z <= -1e+42) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= -7.1e-140) tmp = t_1; elseif (z <= 1.25e-179) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 1.05e+36) tmp = t_1; else tmp = Float64(x - Float64(y / Float64(Float64(a - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (t * (y / (z - a))); tmp = 0.0; if (z <= -1e+42) tmp = x - (y * (z / (a - z))); elseif (z <= -7.1e-140) tmp = t_1; elseif (z <= 1.25e-179) tmp = x + (y / (a / t)); elseif (z <= 1.05e+36) tmp = t_1; else tmp = x - (y / ((a - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+42], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.1e-140], t$95$1, If[LessEqual[z, 1.25e-179], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e+36], t$95$1, N[(x - N[(y / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - t \cdot \frac{y}{z - a}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+42}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq -7.1 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-179}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - z}{z}}\\
\end{array}
\end{array}
if z < -1.00000000000000004e42Initial program 99.9%
Taylor expanded in t around 0 62.5%
+-commutative62.5%
associate-/l*89.0%
Simplified89.0%
if -1.00000000000000004e42 < z < -7.09999999999999986e-140 or 1.2499999999999999e-179 < z < 1.05000000000000002e36Initial program 98.8%
Taylor expanded in t around inf 85.2%
associate-*r/85.2%
mul-1-neg85.2%
distribute-lft-neg-out85.2%
*-commutative85.2%
associate-/l*89.3%
distribute-neg-frac89.3%
distribute-neg-frac289.3%
sub-neg89.3%
mul-1-neg89.3%
distribute-neg-in89.3%
mul-1-neg89.3%
remove-double-neg89.3%
Simplified89.3%
Taylor expanded in x around 0 85.2%
+-commutative85.2%
associate-/l*88.4%
Simplified88.4%
if -7.09999999999999986e-140 < z < 1.2499999999999999e-179Initial program 99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 90.5%
if 1.05000000000000002e36 < z Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 95.3%
Final simplification90.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.5e+36)
(- x (* y (/ z (- a z))))
(if (<= z 9e-179)
(+ x (* y (/ (- t z) a)))
(if (<= z 2.4e+35) (- x (* t (/ y (- z a)))) (- x (/ y (/ (- a z) z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+36) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 9e-179) {
tmp = x + (y * ((t - z) / a));
} else if (z <= 2.4e+35) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x - (y / ((a - z) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.5d+36)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 9d-179) then
tmp = x + (y * ((t - z) / a))
else if (z <= 2.4d+35) then
tmp = x - (t * (y / (z - a)))
else
tmp = x - (y / ((a - z) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+36) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 9e-179) {
tmp = x + (y * ((t - z) / a));
} else if (z <= 2.4e+35) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x - (y / ((a - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e+36: tmp = x - (y * (z / (a - z))) elif z <= 9e-179: tmp = x + (y * ((t - z) / a)) elif z <= 2.4e+35: tmp = x - (t * (y / (z - a))) else: tmp = x - (y / ((a - z) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+36) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 9e-179) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); elseif (z <= 2.4e+35) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); else tmp = Float64(x - Float64(y / Float64(Float64(a - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e+36) tmp = x - (y * (z / (a - z))); elseif (z <= 9e-179) tmp = x + (y * ((t - z) / a)); elseif (z <= 2.4e+35) tmp = x - (t * (y / (z - a))); else tmp = x - (y / ((a - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+36], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-179], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+35], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+36}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-179}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+35}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - z}{z}}\\
\end{array}
\end{array}
if z < -5.5000000000000002e36Initial program 99.9%
Taylor expanded in t around 0 63.8%
+-commutative63.8%
associate-/l*89.4%
Simplified89.4%
if -5.5000000000000002e36 < z < 8.99999999999999984e-179Initial program 98.8%
Taylor expanded in a around inf 84.9%
mul-1-neg84.9%
unsub-neg84.9%
associate-/l*87.7%
Simplified87.7%
if 8.99999999999999984e-179 < z < 2.40000000000000015e35Initial program 99.8%
Taylor expanded in t around inf 87.2%
associate-*r/87.2%
mul-1-neg87.2%
distribute-lft-neg-out87.2%
*-commutative87.2%
associate-/l*94.4%
distribute-neg-frac94.4%
distribute-neg-frac294.4%
sub-neg94.4%
mul-1-neg94.4%
distribute-neg-in94.4%
mul-1-neg94.4%
remove-double-neg94.4%
Simplified94.4%
Taylor expanded in x around 0 87.2%
+-commutative87.2%
associate-/l*91.0%
Simplified91.0%
if 2.40000000000000015e35 < z Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 95.3%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.4e-23) (not (<= z 1.02e-42))) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e-23) || !(z <= 1.02e-42)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.4d-23)) .or. (.not. (z <= 1.02d-42))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e-23) || !(z <= 1.02e-42)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.4e-23) or not (z <= 1.02e-42): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.4e-23) || !(z <= 1.02e-42)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.4e-23) || ~((z <= 1.02e-42))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.4e-23], N[Not[LessEqual[z, 1.02e-42]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-23} \lor \neg \left(z \leq 1.02 \cdot 10^{-42}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -2.39999999999999996e-23 or 1.0199999999999999e-42 < z Initial program 99.9%
Taylor expanded in a around 0 65.4%
associate-/l*84.7%
div-sub84.7%
*-inverses84.7%
Simplified84.7%
if -2.39999999999999996e-23 < z < 1.0199999999999999e-42Initial program 99.0%
clear-num98.9%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in z around 0 84.2%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.7e-24) (not (<= z 2.55e-34))) (- x (/ y (/ (- a z) z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e-24) || !(z <= 2.55e-34)) {
tmp = x - (y / ((a - z) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.7d-24)) .or. (.not. (z <= 2.55d-34))) then
tmp = x - (y / ((a - z) / z))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.7e-24) || !(z <= 2.55e-34)) {
tmp = x - (y / ((a - z) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.7e-24) or not (z <= 2.55e-34): tmp = x - (y / ((a - z) / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.7e-24) || !(z <= 2.55e-34)) tmp = Float64(x - Float64(y / Float64(Float64(a - z) / z))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.7e-24) || ~((z <= 2.55e-34))) tmp = x - (y / ((a - z) / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e-24], N[Not[LessEqual[z, 2.55e-34]], $MachinePrecision]], N[(x - N[(y / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-24} \lor \neg \left(z \leq 2.55 \cdot 10^{-34}\right):\\
\;\;\;\;x - \frac{y}{\frac{a - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -2.70000000000000007e-24 or 2.55e-34 < z Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 87.2%
if -2.70000000000000007e-24 < z < 2.55e-34Initial program 99.0%
clear-num98.9%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in z around 0 84.2%
Final simplification85.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.5e-23) (+ x (* y (- 1.0 (/ t z)))) (if (<= z 2.05e-72) (+ x (/ y (/ a t))) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e-23) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= 2.05e-72) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-8.5d-23)) then
tmp = x + (y * (1.0d0 - (t / z)))
else if (z <= 2.05d-72) then
tmp = x + (y / (a / t))
else
tmp = x + (y / (z / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e-23) {
tmp = x + (y * (1.0 - (t / z)));
} else if (z <= 2.05e-72) {
tmp = x + (y / (a / t));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.5e-23: tmp = x + (y * (1.0 - (t / z))) elif z <= 2.05e-72: tmp = x + (y / (a / t)) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e-23) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); elseif (z <= 2.05e-72) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.5e-23) tmp = x + (y * (1.0 - (t / z))); elseif (z <= 2.05e-72) tmp = x + (y / (a / t)); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e-23], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e-72], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-23}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-72}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -8.4999999999999996e-23Initial program 99.9%
Taylor expanded in a around 0 63.1%
associate-/l*84.3%
div-sub84.3%
*-inverses84.3%
Simplified84.3%
if -8.4999999999999996e-23 < z < 2.05000000000000002e-72Initial program 98.9%
clear-num98.9%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in z around 0 84.1%
if 2.05000000000000002e-72 < z Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 85.0%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.2e+43) (- x (* y (/ z (- a z)))) (if (<= z 4.7e+36) (+ x (* y (/ t (- a z)))) (- x (/ y (/ (- a z) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e+43) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 4.7e+36) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (y / ((a - z) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-8.2d+43)) then
tmp = x - (y * (z / (a - z)))
else if (z <= 4.7d+36) then
tmp = x + (y * (t / (a - z)))
else
tmp = x - (y / ((a - z) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e+43) {
tmp = x - (y * (z / (a - z)));
} else if (z <= 4.7e+36) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (y / ((a - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.2e+43: tmp = x - (y * (z / (a - z))) elif z <= 4.7e+36: tmp = x + (y * (t / (a - z))) else: tmp = x - (y / ((a - z) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.2e+43) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); elseif (z <= 4.7e+36) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x - Float64(y / Float64(Float64(a - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8.2e+43) tmp = x - (y * (z / (a - z))); elseif (z <= 4.7e+36) tmp = x + (y * (t / (a - z))); else tmp = x - (y / ((a - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.2e+43], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.7e+36], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+43}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{+36}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a - z}{z}}\\
\end{array}
\end{array}
if z < -8.2000000000000001e43Initial program 99.9%
Taylor expanded in t around 0 62.5%
+-commutative62.5%
associate-/l*89.0%
Simplified89.0%
if -8.2000000000000001e43 < z < 4.69999999999999989e36Initial program 99.2%
Taylor expanded in t around inf 85.8%
associate-*r/85.8%
mul-1-neg85.8%
distribute-lft-neg-out85.8%
*-commutative85.8%
associate-/l*89.7%
distribute-neg-frac89.7%
distribute-neg-frac289.7%
sub-neg89.7%
mul-1-neg89.7%
distribute-neg-in89.7%
mul-1-neg89.7%
remove-double-neg89.7%
Simplified89.7%
if 4.69999999999999989e36 < z Initial program 99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 95.3%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.05e+36) (not (<= z 3000000000000.0))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.05e+36) || !(z <= 3000000000000.0)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.05d+36)) .or. (.not. (z <= 3000000000000.0d0))) then
tmp = x + y
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.05e+36) || !(z <= 3000000000000.0)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.05e+36) or not (z <= 3000000000000.0): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.05e+36) || !(z <= 3000000000000.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.05e+36) || ~((z <= 3000000000000.0))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.05e+36], N[Not[LessEqual[z, 3000000000000.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+36} \lor \neg \left(z \leq 3000000000000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.05000000000000002e36 or 3e12 < z Initial program 99.9%
Taylor expanded in z around inf 82.2%
+-commutative82.2%
Simplified82.2%
if -1.05000000000000002e36 < z < 3e12Initial program 99.1%
Taylor expanded in z around 0 75.1%
*-commutative75.1%
associate-/l*79.9%
Simplified79.9%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.68e+38) (not (<= z 3700000000000.0))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.68e+38) || !(z <= 3700000000000.0)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.68d+38)) .or. (.not. (z <= 3700000000000.0d0))) then
tmp = x + y
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.68e+38) || !(z <= 3700000000000.0)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.68e+38) or not (z <= 3700000000000.0): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.68e+38) || !(z <= 3700000000000.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.68e+38) || ~((z <= 3700000000000.0))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.68e+38], N[Not[LessEqual[z, 3700000000000.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.68 \cdot 10^{+38} \lor \neg \left(z \leq 3700000000000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.6800000000000001e38 or 3.7e12 < z Initial program 99.9%
Taylor expanded in z around inf 82.2%
+-commutative82.2%
Simplified82.2%
if -1.6800000000000001e38 < z < 3.7e12Initial program 99.1%
clear-num99.1%
un-div-inv99.1%
Applied egg-rr99.1%
Taylor expanded in z around 0 80.0%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + y
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 99.5%
Taylor expanded in z around inf 60.4%
+-commutative60.4%
Simplified60.4%
Final simplification60.4%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.5%
Taylor expanded in x around inf 48.0%
Final simplification48.0%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024039
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))