
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - 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 - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - 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 - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (/ y (/ (- a t) (- z t))) x))
double code(double x, double y, double z, double t, double a) {
return (y / ((a - t) / (z - t))) + 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 = (y / ((a - t) / (z - t))) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return (y / ((a - t) / (z - t))) + x;
}
def code(x, y, z, t, a): return (y / ((a - t) / (z - t))) + x
function code(x, y, z, t, a) return Float64(Float64(y / Float64(Float64(a - t) / Float64(z - t))) + x) end
function tmp = code(x, y, z, t, a) tmp = (y / ((a - t) / (z - t))) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{\frac{a - t}{z - t}} + x
\end{array}
Initial program 88.2%
+-commutative88.2%
associate-/l*98.4%
fma-define98.4%
Simplified98.4%
fma-undefine98.4%
clear-num98.3%
un-div-inv98.7%
Applied egg-rr98.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.6e-71) (not (<= t 1.45e+60))) (+ x (* y (- 1.0 (/ z t)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e-71) || !(t <= 1.45e+60)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (z * (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 ((t <= (-3.6d-71)) .or. (.not. (t <= 1.45d+60))) then
tmp = x + (y * (1.0d0 - (z / t)))
else
tmp = x + (z * (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 ((t <= -3.6e-71) || !(t <= 1.45e+60)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.6e-71) or not (t <= 1.45e+60): tmp = x + (y * (1.0 - (z / t))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.6e-71) || !(t <= 1.45e+60)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.6e-71) || ~((t <= 1.45e+60))) tmp = x + (y * (1.0 - (z / t))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.6e-71], N[Not[LessEqual[t, 1.45e+60]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-71} \lor \neg \left(t \leq 1.45 \cdot 10^{+60}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -3.6e-71 or 1.45e60 < t Initial program 77.2%
+-commutative77.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in a around 0 70.1%
mul-1-neg70.1%
unsub-neg70.1%
associate-/l*89.8%
div-sub89.8%
sub-neg89.8%
*-inverses89.8%
metadata-eval89.8%
Simplified89.8%
if -3.6e-71 < t < 1.45e60Initial program 97.8%
+-commutative97.8%
associate-/l*97.0%
fma-define97.0%
Simplified97.0%
fma-undefine97.0%
clear-num97.0%
un-div-inv97.5%
Applied egg-rr97.5%
associate-/r/97.6%
Applied egg-rr97.6%
Taylor expanded in z around inf 90.1%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.1e+103) (not (<= t 1.9e+98))) (+ y x) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.1e+103) || !(t <= 1.9e+98)) {
tmp = y + x;
} else {
tmp = x + (z * (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 ((t <= (-3.1d+103)) .or. (.not. (t <= 1.9d+98))) then
tmp = y + x
else
tmp = x + (z * (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 ((t <= -3.1e+103) || !(t <= 1.9e+98)) {
tmp = y + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.1e+103) or not (t <= 1.9e+98): tmp = y + x else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.1e+103) || !(t <= 1.9e+98)) tmp = Float64(y + x); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.1e+103) || ~((t <= 1.9e+98))) tmp = y + x; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.1e+103], N[Not[LessEqual[t, 1.9e+98]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+103} \lor \neg \left(t \leq 1.9 \cdot 10^{+98}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -3.1000000000000002e103 or 1.89999999999999995e98 < t Initial program 71.6%
+-commutative71.6%
associate-/l*99.9%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 85.8%
+-commutative85.8%
Simplified85.8%
if -3.1000000000000002e103 < t < 1.89999999999999995e98Initial program 96.1%
+-commutative96.1%
associate-/l*97.7%
fma-define97.7%
Simplified97.7%
fma-undefine97.7%
clear-num97.6%
un-div-inv98.0%
Applied egg-rr98.0%
associate-/r/97.5%
Applied egg-rr97.5%
Taylor expanded in z around inf 88.3%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6e+102) (not (<= t 4.2e+102))) (+ y x) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6e+102) || !(t <= 4.2e+102)) {
tmp = y + x;
} else {
tmp = x + (y * (z / (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 ((t <= (-6d+102)) .or. (.not. (t <= 4.2d+102))) then
tmp = y + x
else
tmp = x + (y * (z / (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 ((t <= -6e+102) || !(t <= 4.2e+102)) {
tmp = y + x;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6e+102) or not (t <= 4.2e+102): tmp = y + x else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6e+102) || !(t <= 4.2e+102)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6e+102) || ~((t <= 4.2e+102))) tmp = y + x; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6e+102], N[Not[LessEqual[t, 4.2e+102]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+102} \lor \neg \left(t \leq 4.2 \cdot 10^{+102}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -5.9999999999999996e102 or 4.20000000000000003e102 < t Initial program 71.6%
+-commutative71.6%
associate-/l*99.9%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around inf 85.8%
+-commutative85.8%
Simplified85.8%
if -5.9999999999999996e102 < t < 4.20000000000000003e102Initial program 96.1%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around inf 85.8%
associate-/l*87.3%
Simplified87.3%
Final simplification86.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -9.4e-8) (- x (/ z (/ (- t a) y))) (if (<= z 3.8e-15) (+ x (* y (/ t (- t a)))) (+ x (/ y (/ (- a t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.4e-8) {
tmp = x - (z / ((t - a) / y));
} else if (z <= 3.8e-15) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y / ((a - t) / 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 <= (-9.4d-8)) then
tmp = x - (z / ((t - a) / y))
else if (z <= 3.8d-15) then
tmp = x + (y * (t / (t - a)))
else
tmp = x + (y / ((a - t) / 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 <= -9.4e-8) {
tmp = x - (z / ((t - a) / y));
} else if (z <= 3.8e-15) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -9.4e-8: tmp = x - (z / ((t - a) / y)) elif z <= 3.8e-15: tmp = x + (y * (t / (t - a))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.4e-8) tmp = Float64(x - Float64(z / Float64(Float64(t - a) / y))); elseif (z <= 3.8e-15) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -9.4e-8) tmp = x - (z / ((t - a) / y)); elseif (z <= 3.8e-15) tmp = x + (y * (t / (t - a))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.4e-8], N[(x - N[(z / N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-15], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.4 \cdot 10^{-8}:\\
\;\;\;\;x - \frac{z}{\frac{t - a}{y}}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if z < -9.3999999999999995e-8Initial program 89.7%
+-commutative89.7%
associate-/l*97.2%
fma-define97.2%
Simplified97.2%
fma-undefine97.2%
clear-num97.1%
un-div-inv98.1%
Applied egg-rr98.1%
associate-/r/98.4%
Applied egg-rr98.4%
Taylor expanded in z around inf 90.8%
*-commutative90.8%
clear-num90.9%
un-div-inv91.0%
Applied egg-rr91.0%
if -9.3999999999999995e-8 < z < 3.8000000000000002e-15Initial program 90.3%
+-commutative90.3%
associate-/l*98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in z around 0 82.0%
mul-1-neg82.0%
unsub-neg82.0%
*-commutative82.0%
*-lft-identity82.0%
times-frac90.9%
/-rgt-identity90.9%
Simplified90.9%
if 3.8000000000000002e-15 < z Initial program 81.4%
+-commutative81.4%
associate-/l*99.8%
fma-define99.9%
Simplified99.9%
fma-undefine99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 87.8%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.26e-36) (not (<= t 1.16e-40))) (+ y x) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.26e-36) || !(t <= 1.16e-40)) {
tmp = y + x;
} else {
tmp = x + ((y * z) / 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 ((t <= (-1.26d-36)) .or. (.not. (t <= 1.16d-40))) then
tmp = y + x
else
tmp = x + ((y * z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.26e-36) || !(t <= 1.16e-40)) {
tmp = y + x;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.26e-36) or not (t <= 1.16e-40): tmp = y + x else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.26e-36) || !(t <= 1.16e-40)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.26e-36) || ~((t <= 1.16e-40))) tmp = y + x; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.26e-36], N[Not[LessEqual[t, 1.16e-40]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.26 \cdot 10^{-36} \lor \neg \left(t \leq 1.16 \cdot 10^{-40}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -1.26000000000000005e-36 or 1.15999999999999991e-40 < t Initial program 78.8%
+-commutative78.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 75.8%
+-commutative75.8%
Simplified75.8%
if -1.26000000000000005e-36 < t < 1.15999999999999991e-40Initial program 99.8%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in t around 0 82.3%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.06e+96) (not (<= y 3.1e+90))) (* y (- 1.0 (/ z t))) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.06e+96) || !(y <= 3.1e+90)) {
tmp = y * (1.0 - (z / t));
} else {
tmp = y + x;
}
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 ((y <= (-1.06d+96)) .or. (.not. (y <= 3.1d+90))) then
tmp = y * (1.0d0 - (z / t))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.06e+96) || !(y <= 3.1e+90)) {
tmp = y * (1.0 - (z / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.06e+96) or not (y <= 3.1e+90): tmp = y * (1.0 - (z / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.06e+96) || !(y <= 3.1e+90)) tmp = Float64(y * Float64(1.0 - Float64(z / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.06e+96) || ~((y <= 3.1e+90))) tmp = y * (1.0 - (z / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.06e+96], N[Not[LessEqual[y, 3.1e+90]], $MachinePrecision]], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{+96} \lor \neg \left(y \leq 3.1 \cdot 10^{+90}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if y < -1.06e96 or 3.09999999999999988e90 < y Initial program 67.9%
+-commutative67.9%
associate-/l*97.7%
fma-define97.7%
Simplified97.7%
fma-undefine97.7%
clear-num97.6%
un-div-inv97.7%
Applied egg-rr97.7%
associate-/r/95.6%
Applied egg-rr95.6%
Taylor expanded in a around 0 31.2%
mul-1-neg31.2%
unsub-neg31.2%
associate-/l*58.0%
Simplified58.0%
Taylor expanded in x around 0 29.0%
associate-/l*51.5%
associate-*r*51.5%
*-commutative51.5%
div-sub51.5%
sub-neg51.5%
*-inverses51.5%
metadata-eval51.5%
associate-*l*51.5%
neg-mul-151.5%
+-commutative51.5%
distribute-neg-in51.5%
metadata-eval51.5%
sub-neg51.5%
Simplified51.5%
if -1.06e96 < y < 3.09999999999999988e90Initial program 98.8%
+-commutative98.8%
associate-/l*98.7%
fma-define98.8%
Simplified98.8%
Taylor expanded in t around inf 71.2%
+-commutative71.2%
Simplified71.2%
Final simplification64.4%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 88.2%
associate-/l*98.4%
Simplified98.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.3e+223) (* z (/ y a)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.3e+223) {
tmp = z * (y / a);
} else {
tmp = y + x;
}
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 <= (-6.3d+223)) then
tmp = z * (y / a)
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.3e+223) {
tmp = z * (y / a);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.3e+223: tmp = z * (y / a) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.3e+223) tmp = Float64(z * Float64(y / a)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.3e+223) tmp = z * (y / a); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.3e+223], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.3 \cdot 10^{+223}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -6.3000000000000005e223Initial program 94.7%
+-commutative94.7%
associate-/l*94.7%
fma-define94.7%
Simplified94.7%
Taylor expanded in t around 0 67.0%
+-commutative67.0%
associate-/l*66.8%
Simplified66.8%
Taylor expanded in z around inf 72.0%
+-commutative72.0%
Simplified72.0%
Taylor expanded in y around inf 61.4%
if -6.3000000000000005e223 < z Initial program 87.7%
+-commutative87.7%
associate-/l*98.7%
fma-define98.7%
Simplified98.7%
Taylor expanded in t around inf 62.5%
+-commutative62.5%
Simplified62.5%
(FPCore (x y z t a) :precision binary64 (if (<= a 2.6e+174) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2.6e+174) {
tmp = y + x;
} else {
tmp = x;
}
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 (a <= 2.6d+174) then
tmp = y + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2.6e+174) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 2.6e+174: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 2.6e+174) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 2.6e+174) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2.6e+174], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.6 \cdot 10^{+174}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 2.5999999999999999e174Initial program 87.3%
+-commutative87.3%
associate-/l*98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in t around inf 60.7%
+-commutative60.7%
Simplified60.7%
if 2.5999999999999999e174 < a Initial program 94.1%
+-commutative94.1%
associate-/l*97.1%
fma-define97.1%
Simplified97.1%
Taylor expanded in y around 0 70.9%
(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 88.2%
+-commutative88.2%
associate-/l*98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in y around 0 48.0%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024165
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
(+ x (/ (* y (- z t)) (- a t))))